Structured Workflow Orchestration for Large-Scale Code Operations with Claude

shopify · E-commerce · 2025 · source Agentic: yes · promotional bias: low · source-backed · extracted with prompt 0.5.6 (schema v2)

Generated from extraction.json — do not edit by hand. Every claim cites verbatim source evidence; stated means the quote directly asserts the claim, implied means it supports it indirectly.

Problem

Domain: Large-scale codebase operations and developer productivity

Shopify needed to run repeatable code operations such as test generation, coverage optimization, type-safety migration, and code migrations across a massive engineering estate where pure agentic workflows accumulated entropy and pure deterministic scripts lacked adaptability.

Constraints:

Architecture

Shopify uses ROAST as a structured workflow orchestrator alongside Claude Code. ROAST handles predefined steps such as coverage measurement, test execution, Sorbet autocorrect, and replayable workflow state; Claude Code can call ROAST workflows as tools, while ROAST can invoke Claude Code through the SDK inside a workflow step, creating a bidirectional deterministic/nondeterministic hybrid.

Diagram confidence: explicit (topology described by the source).

flowchart LR
  developer_or_claude_code["Developer or Claude Code"] --> roast_workflow_orchestrator["ROAST workflow orchestrator"]
  roast_workflow_orchestrator --> coverage_and_test_tools["Coverage and test tools"]
  roast_workflow_orchestrator --> claude_code_sdk_step["Claude Code SDK step"]
  roast_workflow_orchestrator --> replayable_workflow_state["Replayable workflow state"]
  coverage_and_test_tools --> shopify_codebase["Shopify codebase"]
  claude_code_sdk_step --> shopify_codebase
Drag to pan · scroll or use +/− to zoom · reconstructed from the source's described component topology

Components

Component Role Interacts with
Developer or Claude Code Initiates a structured workflow or uses ROAST as a tool. ROAST workflow orchestrator
ROAST workflow orchestrator Executes predefined deterministic and AI-assisted workflow steps. Developer or Claude Code, Coverage and test tools, Claude Code SDK step, Replayable workflow state
Coverage and test tools Deterministic tools for measuring coverage, running tests, and producing reports. ROAST workflow orchestrator
Claude Code SDK step Nondeterministic coding-agent step invoked inside a structured workflow. ROAST workflow orchestrator
Replayable workflow state Saved workflow progress that lets developers replay from intermediate steps. ROAST workflow orchestrator
Shopify codebase Large Rails and repository estate where workflows generate tests, migrate code, and improve coverage. Coverage and test tools, Claude Code SDK step

Data flow

A developer or Claude Code invokes a ROAST workflow for a concrete operation such as test coverage. ROAST runs deterministic steps like coverage tools and tests, then calls Claude Code for bounded code-generation or repair steps. The workflow can replay from intermediate steps during debugging, and Claude Code can also execute predefined ROAST commands as tools.

3 supporting quotes
“running the coverage tool, running the test, you know, to generate the report of what needs to be covered.”transcript, stated
“using roast as a tool for cloud code.”transcript, stated
“as part of the steps in that workflow you can kick off cloud code in SDK”transcript, stated

Why this architecture

Shopify uses a hybrid architecture because deterministic workflows keep repeatable operations grounded, while Claude Code supplies adaptive coding ability within bounded steps. Interleaving the two reduces entropy accumulation in multi-step code operations.

3 supporting quotes
“interle non-deterministic kinds of structured workflow with uh sorry nondeterministic agentic workflows with uh deterministic kind of structured workflows and scripts is actually the”transcript, stated
“take a workflow, a big workflow like let's say optimizing a test suite and you break”transcript, stated
“you don't have to run the first four steps over and over again just to debug the fifth step.”transcript, stated

Models used: Claude Code · Claude Code SDK · ROAST

Scale

Alternatives considered (roads not taken)

Use Claude Code alone for repeatable workflow operations

Rejected because: Agentic tools are nondeterministic and can accumulate entropy across multi-step workflows.

“they're still inherently non-deterministic. And you have something else which is the accumulation of entropy.”transcript, stated

Use only deterministic scripts

Rejected because: Some code operations benefit from agentic coding steps such as generating tests or resolving leftover type errors.

“as part of the steps in that workflow you can kick off cloud code in SDK”transcript, stated

Rerun whole workflows during development

Rejected because: ROAST replay avoids rerunning the first four steps when debugging the fifth step of a workflow.

“if you have a five-step workflow, you don't have to run the first four steps over and over again just to debug the fifth step.”transcript, stated

Patterns

tool-use-orchestration (developer workflow)

ROAST orchestrates coverage tools, tests, commands, replay, and Claude Code within repeatable workflow steps.

“this is a workflow orchestration tool.”transcript, stated
“we are using cloud SDK as a tool for roast.  ”transcript, stated

durable-execution (workflow reliability)

ROAST supports replaying from later workflow steps so developers can debug without rerunning everything.

“You can just go ahead and replay from the fourth step afterwards and then,”transcript, stated

eval-driven-development (code quality)

The workflows use coverage tools, tests, and explicit coverage targets to guide Claude Code edits.

“After each modification run rake test with coverage p you know path to the test etc.”transcript, stated

structured-output-contract (workflow structure)

ROAST turns coding operations into predefined workflow steps rather than free-form agent sessions.

“cloud code to execute a workflow uh a predefined workflow. You could set up commands.”transcript, stated

Tradeoffs

Interleave deterministic and nondeterministic work.

Chose ROAST plus Claude Code over Pure Claude Code or pure scripts.

Rationale: Structured workflows keep repeatable operations reliable while Claude handles adaptive code-generation or repair subtasks.

“interle these deterministic and non-deterministic ”transcript, stated
“as part of the steps in that workflow you can kick off cloud code in SDK”transcript, stated

Make ROAST callable by Claude Code and vice versa.

Chose Bidirectional integration over A one-way wrapper around the coding agent.

Rationale: Claude Code can execute predefined workflows, while ROAST workflows can invoke Claude Code for agentic steps.

“one way of using roast as a tool for cloud code.  ”transcript, stated
“we are using cloud SDK as a tool for roast.  ”transcript, stated

Gotchas (what bit them)

Nondeterministic agents accumulate errors across multi-step workflows.

Root cause: Each free-form step can drift slightly, making later steps harder to complete.

Resolution: Break large tasks into structured workflows and give the agent only bounded work at each step.

“at every step of a given workflow that you just give”transcript, implied
“you take a workflow, a big workflow like let's say optimizing a test suite and you break”transcript, stated

Workflow debugging becomes expensive without step replay.

Root cause: A five-step workflow would otherwise rerun earlier steps when only the fifth is under development.

Resolution: Use ROAST's replay capability to resume from an intermediate step.

“if you have a five-step workflow, you don't have to run the first four steps over and over again just to debug the fifth step.”transcript, stated

Evaluation

The talk evaluates ROAST through adoption, workflow examples, test coverage workflows, and operational fit at Shopify scale.

Metrics: About 5,000 repositories. · Over half a million tests in the main app. · About 500 daily active users. · Peak of 250,000 requests per second. · Example coverage target above 90% branch coverage.

“of code. It's probably about 5,000 uh repos uh in  ”transcript, stated
“have at peak now about 500 daily active users and that number is growing rapidly. And as of lately, we hit 250,000 requests per second at at peak,”transcript, stated

Outcomes

The talk reports about 5,000 repos, millions of lines of code, over half a million tests, 500 daily active users, and a 250,000 RPS peak.

“test grading and optimization probably for five or  ”transcript, implied
“tool like roast, you can do that and have all your  ”transcript, implied