- CLI Reference
- Commands
- ironflow invoke
ironflow invoke
Directly invoke a function by ID.
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:
| Argument | Required | Description |
|---|---|---|
function-id | Yes | The function to invoke (e.g., process-order) |
Flags:
| Flag | Short | Type | Default | Description |
|---|---|---|---|---|
--data | -d | string | Inline JSON input data (defaults to {}) | |
--data-file | -f | string | Path to JSON file with input data (- reads stdin) | |
--metadata | -m | string[] | Key=value metadata pairs (repeatable); ignored unless --no-wait | |
--no-wait | bool | false | Fire-and-forget (don’t wait for result) | |
--timeout | -t | duration | 30s | Max wait time |
--json | bool | false | Output as JSON instead of human-friendly text | |
--idempotency-key | string | Deduplication 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 | -s | string | IRONFLOW_SERVER_URL or http://localhost:9123 | Server 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:
# Invoke and wait for result (default)ironflow invoke process-order --data '{"order_id": "123"}'
# Fire-and-forgetironflow invoke send-notification --data '{"user_id": "456"}' --no-wait
# With custom timeoutironflow invoke generate-report --data '{}' --timeout 120s
# Pipe from stdincat complex-input.json | ironflow invoke generate-report --data-file -
# JSON outputironflow invoke process-order --data '{"order_id": "123"}' --jsonOutput (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_abc123In 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.