# Gotchas

> The workflow behaviors that surprise people most — test calls running the draft, schedules read as intervals, sub-workflows that fail behind an out port, nodes that run twice, renamed labels and more — and what to do about each one.

Source: https://docs.sommatic.ai/en/workflows/gotchas/ (updated 2026-11-26)

Each item below has broken a real workflow. For problems inside expressions, see
[expression gotchas](https://docs.sommatic.ai/en/expressions/gotchas.md).

## Test calls run the draft

A webhook called with `test` runs the saved draft, so **Save draft** changes what those calls do immediately. Give
external systems the `prod` URL and publish when a change is ready.

## A prod call needs a published version

A `prod` webhook to a workflow that was never published returns `No published version found for this workflow`. The
same applies to schedules (unpublished workflows are not scheduled) and to sub-workflows called from published
workflows.

## Sub-workflows follow the caller's mode

`workflow.chain` runs the target's draft when the caller is a test run, and the target's published version when the
caller is published. A change in a sub-workflow's draft is invisible to production until you publish the
sub-workflow.

## A failed sub-workflow can leave through out

In `sync` mode, `workflow.chain` leaves through `out` whenever the call worked, even if the target run ended `failed`.
Check `{{ $json.status === 'completed' }}` with `flow.if` after it.

## Cron expressions are intervals

The scheduler reads `cron_expr` as the time between runs: `0 9 * * *` runs once a day counted from the last run, not
every day at 09:00, and `timezone` does not move the schedule. If the time of day matters, check it in the workflow
with an expression on `$now` and a `flow.if`.

## Schedule settings come from the draft

The scheduler reads `cron_expr` and `polling_interval` from the saved draft, but runs the published version. A new
interval applies when you save; a new graph applies when you publish.

## A node reached by two branches runs twice

When two branches lead to the same node, it runs once per branch. Merge items from `flow.split` with `flow.join`, and
avoid joining ordinary branches into one node unless running it twice is what you want.

## A node continues only through a port its worker returns

An edge from a declared port fires only if the node actually returns that port. Some nodes do not return their
declared success port yet (`ai.classify`, `ai.embed`, `ai.extract`, `ai.prompt`, `metrics.emit`, among others), and
some secondary ports are never returned (`timeout` on `flow.join`, `throttled` on `flow.rate.limit`, `miss` on
`ai.vector.search`). Check the node's status note in the [catalog](https://docs.sommatic.ai/en/nodes.md) before you wire a branch to a port.

## flow.switch takes one port

`flow.switch` leaves through the first case that matches. Turning off **Stop on First Match** does not send the input
to several ports: the other matches only appear in `meta.matched`. To act on several matches, use several `flow.if`
nodes in a fan-out.

## Routers pass the input through

`flow.if` and `flow.switch` do not change the data: the node after them receives the same `$json` they received. If
`flow.if` itself fails, it leaves through `error` without data.

## Renaming a node breaks expressions

`$('Classify request')` finds a node by its label. Rename the node and every expression that used the old label stops
finding it; the node behaves as if it had not run. Search for the old label before renaming.

## Retry settings are ignored by most nodes

Only `io.http`, `integrations.microsoft.azure.blob`, `integrations.mongodb.operation` and `ai.classify.triage` retry.
**Continue On Fail** is not applied by any node. Connect the `error` port instead. See [Limits](https://docs.sommatic.ai/en/workflows/limits.md).

## A run ending on error is failed

If the last node that runs leaves through `error`, the run is `failed`, even if earlier branches succeeded. If the
`error` port leads to recovery nodes that finish normally, the run is `completed`.

## Run workflow only runs saved drafts

**Run workflow** refuses to start while there are unsaved changes, because a run executes the saved draft. **Execute
step** is different: it runs one node with the configuration you see on the canvas, saved or not.

## Sample data skips the trigger

While any sample data is set in the studio, **Run workflow** skips the trigger (except a webhook trigger, which always
waits for a real call). Clear the sample data to test the trigger itself.

## Tests have real effects

Test runs execute every node for real: HTTP calls, emails and database writes happen. Point those nodes to test
systems while you iterate.

> **Tip: When in doubt, open the run**
>
> The **Runs** tab shows, for every node, the port it chose and its output. Most surprises become obvious there.

## Next steps

- [Expression gotchas](https://docs.sommatic.ai/en/expressions/gotchas.md): Object literals, mixed fields, wrapped code results and more.
- [Limits](https://docs.sommatic.ai/en/workflows/limits.md): Steps, retries, timeouts and sizes.
- [Testing](https://docs.sommatic.ai/en/workflows/testing.md): Catch these before production.
