Skip to content
Ironflow is pre-1.0: APIs can change between releases. Pin a version. What is ready →

ironflow invoke

Directly invoke a function by ID.

Terminal window
ironflow invoke <function-id> [flags]

By default, the command is synchronous — it blocks until the function completes and prints the output. Use --no-wait to fire-and-forget.

Under the hood, invoke emits a synthetic event ironflow.invoke.<function-id> and auto-registers a trigger for it on the target function if one doesn’t already exist.

Arguments:

ArgumentRequiredDescription
function-idYesThe function to invoke (e.g., process-order)

Flags:

FlagShortTypeDefaultDescription
--data-dstringInline JSON input data (defaults to {})
--data-file-fstringPath to JSON file with input data (- reads stdin)
--metadata-mstring[]Key=value metadata pairs (repeatable); ignored unless --no-wait
--no-waitboolfalseFire-and-forget (don’t wait for result)
--timeout-tduration30sMax wait time
--jsonboolfalseOutput as JSON instead of human-friendly text
--idempotency-keystringDeduplication key. A repeat invoke with the same key returns the original run instead of starting a second one. Keys are shared across the environment, so use one key per operation (for example order-123-placed) and never reuse it for a different event or function
--server-sstringIRONFLOW_SERVER_URL or http://localhost:9123Server URL

Data input follows the same rules as emit (flag or file, --data-file - for stdin, error on conflict, default {}).

--metadata only reaches the run in fire-and-forget mode. The synchronous path (the default) sends no metadata. It prints a warning when you pass some, unless you also pass --json.

Examples:

Terminal window
# Invoke and wait for result (default)
ironflow invoke process-order --data '{"order_id": "123"}'
# Fire-and-forget
ironflow invoke send-notification --data '{"user_id": "456"}' --no-wait
# With custom timeout
ironflow invoke generate-report --data '{}' --timeout 120s
# Pipe from stdin
cat complex-input.json | ironflow invoke generate-report --data-file -
# JSON output
ironflow invoke process-order --data '{"order_id": "123"}' --json

Output (sync):

Invoking process-order (timeout: 30s)...
✓ process-order completed in 1200ms
Output: {"order_confirmed":true}

Output (—no-wait):

Invoked process-order (event: evt_01HN8K3X5Y)
Run ID: run_abc123

In the default synchronous mode, an expired --timeout exits 1 and the run continues. A failed run exits 1 too, with or without --json. With --json, the command prints the full result on stdout before it exits. A run that paused after exhausting its retries (status PAUSED, last error shown) exits 1 in both modes, and the message names ironflow run resume <run-id>. With --no-wait, the command exits as soon as the run is queued, so --timeout has no effect.