An article is the output with the most that can go wrong: it makes factual claims, it cites sources, and a person will put a brand's name on it. Its pipeline is the most elaborate in Studio. It is a state machine with two levels, written with LangGraph, and this page goes through its structure, its state and the choice of model at each node.

Two graphs

Two bands. Main graph: select_topic, where the editor-in-chief sets topic, outline and keywords; team_dispatch, which runs the team subgraph and streams its progress; parallel_enrich, adding images and SEO fields at the same time; final_review, which approves or sends back to the team with a dashed arrow labelled revise; and finalize, which ends the run so that the article waits for approval. Team subgraph with the GEO flag on: brand_ammunition, verified brand facts for this article; preflight_brief, the article type and what it has to cover; researcher, search then claims mapped to sources; research gate, pass or the team ends without writing; writer, the user's model reading the revision guide; and reviewer, with fact check, editor and SEO in parallel and a dashed arrow labelled rewrite back to the writer. A note: there is no checkpointer; run state is the article document in MongoDB with the current step, the draft version and a heartbeat, and a retry rebuilds the graph from the step that failed.
Figure 1. The main graph has five steps. Its second step runs a team subgraph, which has its own loop between the writer and the reviewer.

The main graph is the editorial process.

StepWhat it does
select_topicAn editor-in-chief node picks the topic and builds an outline and keywords
team_dispatchRuns the team subgraph and writes its sub-steps to the database as they happen, with labels such as writer:2
parallel_enrichFinds or generates images and writes search metadata, concurrently
final_reviewApproves the article or sends it back to the team
finalizeEnds the graph. The pipeline then stores the article as waiting for a person’s approval

The one conditional edge in the main graph is after the final review.

def _check_final_review(state: ArticleState) -> str:
    """After final review, either finalize or go back for revision."""
    if state.get("status") == "approved":
        return "finalize"
    else:
        return "team_dispatch"

graph.add_conditional_edges(
    "final_review",
    _check_final_review,
    {"finalize": "finalize", "team_dispatch": "team_dispatch"},
)

The team subgraph is the desk that writes. There are several teams, one per subject area such as technology, economy or lifestyle, registered by id and built from the same template. A team researches, writes and reviews, and loops between writer and reviewer until the review passes.

With the stricter mode enabled by a flag, the team gains three nodes at the front and a hard gate after research. The wiring, shortened:

graph.set_entry_point("brand_ammunition")
graph.add_edge("brand_ammunition", "preflight_brief")
graph.add_edge("preflight_brief", "entry_router")
graph.add_conditional_edges(
    "entry_router", _should_skip_research,
    {"researcher": "researcher", "writer": "writer"},
)
# RESEARCH VALIDATION GATE (hard blocking edge): pass → writer, fail → END(team)
graph.add_conditional_edges(
    "researcher", _research_gate,
    {"writer": "writer", END: END},
)
graph.add_edge("writer", "reviewer")

Three routing functions decide the conditional edges, and each reads one field of the state.

FunctionReadsRoutes
_should_skip_researchWhether research data already existsTo the writer when it does, which is the resume case
_research_gateresearch_gate_pass, defaulting to trueTo the writer, or ends the team without writing
_should_retry_or_finishreview_passedEnds the team, or back to the writer

One state

Both graphs pass one typed dictionary. Its fields fall into groups, and each node writes only its own.

GroupFields
InputPlatform, team, topic seed, user guide, brand and workspace ids, the writer’s provider and model
TopicTopic, outline, keywords
ResearchResearch data, sources
WritingDraft, draft version
ReviewFeedback, whether review passed, fact-check issues, a revision guide, a report from the deterministic rules
EnrichmentImages, thumbnail, search title and description, tags
TrackingA model log, human approval and feedback, status, error
Strict mode onlyArticle type and brief, brand facts, a source inventory, citations, gate results and their reasons, findings from each gate

Two fields carry the loop. draft_version counts rewrites, and every ceiling in the system is expressed in it. revision_guide is what the reviewer writes for the writer: on the second and later drafts the writer’s prompt includes it, with required fact corrections listed first.

The model_log field is a list that each node appends to, recording which model actually ran. When an article reads oddly, the log says which combination produced it.

A model per node

A table with three columns: node, model, and why that one. Topic and writer: the user's choice, from the request, then the workspace setting, then the default; because writing voice is the thing users have opinions about. Researcher: a web-search API, then a model to synthesise what it found; because facts come from retrieval and not from the writer's memory. Fact checker: in the default mode the other vendor from the writer, plus claim verification by search, and in strict mode a fabrication audit on a fixed Claude model; because a model reviewing its own vendor's output shares its blind spots. Editor reviewer: Claude. SEO reviewer: GPT; three reviewers run in parallel and one crashing does not fail the review. Images: a model plans the sections, with image search first and generation as the fallback; a real image is preferred to a generated one. Final review: the other vendor from the writer, the same cross-check as the fact checker.
Figure 2. Model choice by node. The writer is the user's choice. In the default mode the fact checker and the final reviewer use the other vendor, while the editor and SEO reviewers are fixed. The strict mode replaces the fact checker with a fabrication audit on a fixed model.

The writer’s model is resolved in three steps: the value in the request, then the workspace’s setting, then a default from configuration.

The reviewer’s model is not configurable in the same way. It is derived from the writer’s.

def get_reviewer_llm(writer_provider: str) -> ChatOpenAI | ChatAnthropic:
    """Get cross-check reviewer LLM — automatically the opposite of writer_provider."""
    if writer_provider == "openai":
        # Writer is GPT → Reviewer is Claude
        kwargs: dict = {
            "model": settings.claude_model,
            ...
        }
        return ChatAnthropic(**kwargs)
    # Writer is Claude → Reviewer is GPT
    kwargs = {
        "model": settings.gpt_model,
        ...
    }
    return ChatOpenAI(**kwargs)

Lines are removed where ... appears: temperature, token limits, timeouts, retries and API keys. Two callers use this function: the final review in the main graph, and the fact checker of the default mode. The strict mode’s fabrication audit does not, and runs on a fixed Claude model whichever vendor wrote the draft.

In the strict mode, outputs that feed code are constrained. Its research node forces a tool call whose schema is a list of claims, each with a source URL, and its fabrication check uses a tool call against the citations. The model cannot answer in free prose where a structure is expected.

Running, stopping and resuming

Two phases. A run can stop after select_topic and wait for the user to confirm the outline. Confirming starts the second phase from team_dispatch.

Progress. The pipeline iterates over the graph’s stream. After each step it writes the next step’s name and a selected set of state keys to the article document. One rule protects against the commonest corruption: an empty draft never overwrites a non-empty one.

No checkpointer. LangGraph offers checkpointing, and this graph is compiled without it. The article document already holds what a resume needs: the current step, the draft and its version, the research. A retry works out which step failed and builds a graph that contains only the remaining steps.

Rejection. Rejecting a finished article stores the person’s feedback and sets the status to rejected. A later retry on that article runs a revision pass with the feedback in the state.

Failure modes

What happensWhat the system doesCovered by
The pipeline raises in a single-phase runThe article is marked failed and its credits are refundedCredit wiring tests for failed runs
The pipeline raises after the outline was confirmedThe article is marked failed and the charge from the first phase staysThe generate route, which passes no refund reference to the second phase
The run is cancelledThe article is marked cancelledThe pipeline’s cancellation branch
The image or metadata node failsThe failure is swallowed and the article continues without that partThe enrich node’s error handling
One of the three reviewers crashesThe others’ results are used, with a neutral default for the missing scoreThe review node gathers with exceptions returned
Research is already present on a retryThe researcher is skippedThe entry router’s condition
The research gate fails outrightThe team ends without calling the writertest_research_gate_blocks_writer_when_gate_false
The process dies mid-runThe heartbeat stops, the sweeper marks the document as an errorThe sweeper and start-up recovery

Graph wiring has its own tests: that the team subgraph has the original topology with the flag off, and that the strict nodes are inserted in order with it on.

Limits

  • The main graph lives in the app layer. The domain package holds the nodes and the team graph. The outer graph and the editor-in-chief node are under the API app, which the layering rules list as known debt.
  • Reviewers fail open. A crashed reviewer contributes a neutral score. That keeps runs moving, and it means a review can pass with one reviewer missing.
  • Resume is by step, not by node. A retry restarts a whole step. Inside the team, work done before the failure is repeated unless research was already saved.
  • The strict mode is behind a flag that defaults to off. Both topologies are in the code and both are tested.