Templates / Run a generic state machine runtime with Data Tables and sub-workflows

Run a generic state machine runtime with Data Tables and sub-workflows

Ready for 3.0

by Tom Last · 2 views · created 2026-10-04 · Engineering

Ready for 3.0. This template uses no nodes that n8n 3.0 removes. No removed nodes, versions or helpers found. Static check, last run 2026-12-01.

📬 Weekly n8n 3.0 breakage alerts, free

What this workflow does

This workflow has 19 nodes and runs when another workflow calls it. It uses only n8n's built-in nodes.

How it runs

Trigger: When another workflow calls it.

  1. Prepare Event (Code): runs custom JavaScript code
  2. Read Machine Definitions (Data table): get
  3. Load Machine Definitions (Code): runs custom JavaScript code
  4. Find Event (Data table): get
  5. Plan Transition (Code): runs custom JavaScript code
  6. Append Event? (If): checks a condition and branches into true / false
  7. Append Event (Data table): uses Data table
  8. Existing Result (Code): runs custom JavaScript code
  9. After Append (Code): runs custom JavaScript code
  10. Has Task? (If): checks a condition and branches into true / false

…plus 8 more steps. See the full node list below.

Before you upgrade to n8n 3.0

Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.

Check at runtime on n8n 3.0
  • Code node: the task timeout drops from 300s to 60s. Test with a realistic data volume.
Informational: a static scan can't see the data, so test these on your own instance. Status above is unchanged.

Nodes used (5)

From the author

Quick overview This workflow acts as a generic state-machine runtime in n8n, replaying a case from an event stream stored in Data Tables, validating and appending new events, and optionally dispatching an entered-state task by starting a bound n8n…

Excerpt from Tom Last's description on n8n.io.

View the original on n8n.io → Check your own copy

Get the weekly “what broke” email

New templates, newly broken ones, and n8n release changes. One short email a week.

Form not loading? Subscribe here.