Pass input and read results
Send JSON to a run with --payload. Read what the task returns with run:get.
1 · Read the payload in your task
The first argument of run is the payload, and what you return is the result.
export async function run(payload, _ctx) {
console.log("hello from run, name =", payload.name);
return { greeting: `hello ${payload.name ?? "world"}` };
}2 · Set a default payload
run.payload in task.yaml is the input when you pass none.
run:
payload: { name: "world" }3 · Pass a payload for one run
--payload replaces the default for this run only. It must be valid JSON.
$ ignitify task:run hello --payload '{"name":"Ada"}'✓ Run Submittedrun_id 019fdec1-7a40-7c3e-9b1d-3e5f0a8c4d21resource_id run_Qm3TbX8kLw2Zstatus PENDING
4 · Read the result
run:get prints the run and its Result. A failed run shows the error there.
$ ignitify run:get run_Qm3TbX8kLw2ZRun Detailsid 019fdec1-7a40-7c3e-9b1d-3e5f0a8c4d21resource_id run_Qm3TbX8kLw2Zstatus COMPLETEDtask_name hellopreset std.microtimeout_sec 120created_at 2026-10-14T18:51:01.241ZResult: { "greeting": "hello Ada" }
5 · Read the logs
run:logs prints the console output of the run. Your own console.log lines start with [task].
$ ignitify run:logs run_Qm3TbX8kLw2Z | grep '\[task\]'[task] INFO: hello from run, name = Ada
6 · Stay inside the size limits
A payload is at most 10 KiB and a result at most 10 KiB. The CLI refuses a payload that is too big before it sends it.
$ ignitify task:run hello --payload "$(cat big.json)"Error: payload is <n> bytes; the limit is <n> bytes
Retry a run safely
A script that retries task:run after a network error can start the same run two times. Give the run an idempotency key to prevent this. You need CLI 2.0.0 or later.
$ ignitify task:run hello --deployment dep_Hn4TqXw8Zc2P --payload '{"name":"Ada"}' --idempotency-key order-4711- The key is 8 to 255 characters of
A-Z a-z 0-9 . _ : -. The CLI checks it before it sends the request. - A retry with the same key gets the answer of the first request and starts no second run. The CLI then says on stderr:
this is the answer to an earlier request with the same --idempotency-key; no new run was started. - The same key with a different request is refused. Use a new key for each new run.
- Inside the task,
ctx.run.id(ctx.Run.IDin Go) is therun_…id of the run, itsresource_id. Use it as the key when your task writes to another system, so a platform retry of the run does not write twice. See Read the slot in your task for the slot of a schedule. - Pin
--deploymentin a script that retries. Without it, a deploy between two tries changes the request, and the retry is refused.