Test runs

Test a workflow before it goes live: free dry runs with mocked outputs or live tests with real events, input samples, forced outcomes and the test transcript.

On this page

A test run walks a workflow step by step and paints each step on the graph as it goes, so you can see which path a run takes, what each step produces and where it would stop for a person. Test your draft before you apply it, and test a new workflow before you turn it on.

There are two modes. A dry run costs nothing and never leaves Duun. A live test does everything a real run would.

Start a test

  1. Open the factory’s Workflows tab and pick the workflow. To test unapplied edits, stay on your draft; to test a past version, select it in Version N ▾ first.
  2. Choose Test in the toolbar. The Test this workflow dialog opens: “Runs v6 step by step and paints each step on the graph as it goes.”
  3. Pick Dry run or Live test.
  4. Pick an Input sample.
  5. Optionally set Force outcome for each decision.
  6. Choose Start dry run or Start live test.

Dry run or live test

Dry runLive test
Agent stepsSimulated; outputs are generated from each step’s declared fieldsReal agents in real sandboxes
ChecksSimulated; CI passes most of the time so retries get exercisedYour real commands
Notify, Send to URL, DeliverMocked: “Would post…”, “Would POST…”, “Would open a PR…”Real: posts to Slack, calls the URL, opens a PR
Cost“Nothing leaves Duun; costs $0.”“This triggers real events and uses credits.”
Budget pauseShown with simulated costReal, at Pause and ask at

Use dry runs freely while editing: they check the shape of the workflow (order, branches, references, gates) in seconds. Use a live test once, on a real issue, before you resume the workflow or rely on a new trigger.

Input samples

The input sample is what the test pretends started the run.

SampleWhen it’s offered
An issuePick a recent issue from your connected tracker; it fills {{trigger.issue.*}} and {{input.issue}}
Webhook sample payload“From the webhook trigger’s sample”, when the workflow has a Webhook trigger; it fills {{trigger.body.*}}
Manual run (no input)“Starts as if from New run”, when nothing else applies

Force outcome

Each Decide step gets a Force outcome picker: Auto (“Let the decision run”) or one of its outcomes, including Otherwise. Forcing outcomes lets you walk every branch on purpose. The transcript marks forced decisions, for example “Decided: Small (forced)”. Branches that weren’t chosen show as skipped with “Not this route”.

While it runs

The graph shows each step’s state, duration and cost. The chat pane becomes the test transcript: a line when each step starts and finishes, with its outputs collapsible (Outputs · 2 fields) and references resolved, such as “Would post to #factory-platform: “Plan ready: add refund_events table””.

The toolbar shows progress, for example Testing… 4/7 · $0.42, and Stop test. Stopping ends the test at once: “Test stopped. Nothing after this point ran.”

Steps that need you

When the test reaches a Human step or a User approval gate, it waits: the transcript shows Needs you: Approve plan with Approve and Send back. Send back follows the gate’s On fail: it returns to the target step with the attempt count increased, so you can check your return paths.

Repeat for each

A Repeat for each step fans out three sample items in a dry run (“Fanned out ×3 (up to 2 at a time)”) and shows each item’s state under it.

Budget pause

Tests accumulate cost against the workflow’s Budget per run. When spend reaches Pause and ask at, the test pauses with Budget 80% reached and asks whether to continue. Continuing raises the budget for this test only (“Budget raised for this test. Continuing.”). This is exactly what a real run’s budget ask looks like, so it’s a good way to check your limits. See Limits and budgets.

Results

When the test finishes, a summary card shows the result:

  • Test passed, with the path taken (for example “Main path” or “Small”), total time and cost
  • Test failed at CI checks, with a Failures list explaining each failure

Open as run turns the test into a run in the factory’s Runs tab, bound to the version you tested, so you can inspect it like any other run or share it with a teammate.

Testing from the API and CLI

Tests are available in the Preview API and CLI. A test is a run with test: true.

# Dry run the draft in a local file against a sample input
duun workflows test platform-features.yaml --input issue=PLT-482

# Live test the applied workflow
duun workflows test wf_9c1d --live
{
  "mode": "dry",
  "input": { "issue": "PLT-482" },
  "force_outcomes": { "size-route": "Small" }
}

The JSON above is the body of POST /v1/workflows/{workflow_id}/test. See Workflows API.

A testing checklist

Before you turn a workflow on:

  1. Dry run every outcome of every decision with Force outcome.
  2. Send back every approval once to check the On fail path.
  3. Check that Notify messages and Send to URL bodies read well with references resolved.
  4. Run one live test on a real, low-risk issue.
  5. Check the live test’s cost against your Budget per run.

    Type to search the docs, help center and blog.