Codemation Docs
NodesCore

Manual Trigger

Start a workflow manually and optionally seed the run with test items.

… stars

Manual Trigger

Description

ManualTrigger starts a workflow manually. It is the best default trigger for local development, smoke tests, and examples where you want deterministic starter items.

Examples

Basic usage: seed one starter item

workflow("wf.starter.hello")
  .name("Starter Hello")
  .manualTrigger("Start", { step: "start" })
  .map("Mark ready", (item, _ctx) => ({ ...item.json, ready: true }))
  .build();

Example output:

[
  {
    "json": {
      "step": "start"
    }
  }
]

Advanced usage: seed a batch for local workflow testing

workflow("wf.demo.batch")
  .name("Batch demo")
  .manualTrigger("Seed test orders", [
    { orderId: "ord_1", total: 120 },
    { orderId: "ord_2", total: 450 },
  ])
  .map("Summarize batch", (item, _ctx) => item.json)
  .build();

Fluent helper callbacks such as .map(...), .if(...), and .switch({ resolveCaseKey }) receive the full workflow item plus execution ctx. Read row fields from item.json, and use ctx.data when you need outputs from earlier completed steps.

Example output:

[
  {
    "json": {
      "orderId": "ord_1",
      "total": 120
    }
  },
  {
    "json": {
      "orderId": "ord_2",
      "total": 450
    }
  }
]

On this page