clay routines runs get to fetch status and results.
--input or --bulk is required.
Arguments
| Argument | Description |
|---|---|
routineId | Routine id, e.g. function:t_abc123. Required. |
Flags
| Flag | Description |
|---|---|
--input <file|-> | Inline run body as a JSON object matching { "items": [{ "id": <string>, "inputs": <object> }] }. Use - for stdin. |
--bulk <file.jsonl> | JSONL file for a batch run. Each line is { "id": <string>, "inputs": <object> }. The file is uploaded to Clay before the run is started. |
--webhook-id <id> | Registered webhook id to notify when the run finishes. See clay webhooks. |
Output
Inline run:| Field | Type | Description |
|---|---|---|
routineRunId | string | Pass to clay routines runs get. |
mode | "inline" | "bulk" | Which mode was used. |
status | "in_progress" | Always "in_progress" at start. |
fileId | string (bulk only) | Id of the uploaded JSONL file. |
Errors
| Code | Exit | Notes |
|---|---|---|
validation_error | 2 | Missing or conflicting input flags, unreadable file, invalid JSON body, or a JSONL row that fails the { "id": <string>, "inputs": <object> } shape (error names the line). |
not_found | 6 | No routine with that id in this workspace. |
auth_forbidden | 3 | The API key lacks access to run this routine. |

