Dynamic Workflows are available in any Devin session — just describe the work and ask Devin to run it as a workflow.
What are Dynamic Workflows?
A dynamic workflow is a deterministic Python script that orchestrates a team of Devin agents. Devin writes the script, runs it, and the script decides which agents run, in what order, and what each one is told — using the structured results of earlier agents to build the prompts of later ones. Every agent call is recorded, so a workflow run is observable while it executes and resumable if it is interrupted: completed agents replay their recorded results instantly, and only the unfinished work runs again. This goes a step beyond managed Devins, where the coordinating session spawns and babysits child sessions by hand. In a workflow, the orchestration itself is code.When to use a workflow
Ask for a workflow when the work has real structure:- Wide fan-out with a combine step — roughly five or more independent units (files, modules, endpoints, tickets) that each need judgment or verification, whose results are then rolled up.
- A staged pipeline — later stages consume the structured output of earlier ones, for example audit → fix → verify.
- The change is mechanical — a codemod, linter autofix, or generator does it faster and more reliably than agents.
- Only one or two independent sessions are needed, with no data flowing between them.
- The work is tightly coupled through shared state, or is small and sequential.
Example prompts
You describe the task and ask for a workflow; Devin writes the script. Migration — fan out one agent per unit on its own branch, then roll up:How a run works
- Devin writes the script to a file and starts the run. You approve it first unless you have turned on auto-approval in Settings → Preferences → Auto-approve workflows.
- The script runs on Devin’s machine. Workflow primitives are injected automatically — nothing to install or import.
- Each agent call spawns an agent and waits for its structured output. By default that agent is an independent Devin session on its own VM.
- Progress streams into the session. The workflow panel shows each phase, its agents, and their live status; you can open any agent’s session from there.
- Results are recorded against a run ID, which is what makes resuming possible.
Authoring model
The script is plain Python. Devin writes it, but it helps to know the shape when you review one:
Each
agent() call takes a JSON Schema and returns a dict shaped by it, which is how one stage’s findings become the next stage’s prompt. Keep schemas small and flat.
Example
An audit-then-fix pipeline across three modules:Where agents run
Each agent runs on its own VM by default, and can instead be pinned to the orchestrating session’s machine.Separate VM (default)
A full child Devin session with its own machine, repo clones, and environment. It cannot see the orchestrating session’s files, so code handoffs go through git branches: each agent pushes a branch and reports the branch name, and later stages read it from the structured output.
Shared VM
The agent runs on the orchestrating session’s machine and shares its working tree, including uncommitted changes — no git handoff needed. Use it when agents must read or edit the current working tree, or when the repo only exists on that machine.
Determinism and resuming
A workflow script is re-executed from the top when a run resumes, and each agent call is keyed by a hash of its prompt, schema, and execution settings. Everything that already completed replays from its recorded result; the rest runs fresh with new sessions. That only works if the script makes the same calls every time. Workflow logic and prompts must not depend on the current time or date, randomness, generated IDs, environment variables, filesystem state, or network responses. Anything that needs to inspect the outside world belongs inside anagent() call, whose recorded output the rest of the script consumes.
Two consequences worth knowing:
- Editing a prompt re-runs that agent and everything downstream of it, while untouched earlier agents still replay.
- A run that timed out or was interrupted picks up where it left off when resumed with its run ID. The default and maximum budget for a run is seven days.
Cost
Every agent in a workflow is a Devin session, so one run can consume far more ACUs than doing the same task in a single session. Before pointing a workflow at an entire repo, run it on a slice — one directory, three modules, a narrower question — and check the ACU usage of the agents in the workflow panel. Asking for a cheaper mode on high-volume stages, such as per-item classification, also keeps a wide fan-out affordable.Saving a workflow for reuse
Once a workflow works, it can be committed to your repo as a skill: aworkflow.py next to a SKILL.md describing when to use it. Devin then discovers and reruns it on future tasks instead of authoring a new script. Ask Devin to save a workflow and it will create the necessary files for you.
Related
- Advanced Capabilities — orchestrating managed Devins directly
- Skills — saving reusable procedures, including workflows, in your repos
- Devin MCP — creating and monitoring sessions programmatically

