Skip to content
Engine API

Executions

Executions endpoints of the MedHook engine API: 12 operations with parameters, schemas and a curl example for each.

On this page

Inspect, stream, replay, and cancel workflow executions.

List executions

get/api/executions

Returns cursor-paginated execution history ordered by (startedAt desc, id desc). Only executions in the caller's workspace are returned (executions are stamped with their workflow's workspace). In-flight executions cached only in Redis (not yet persisted to Postgres) are merged into page 1 when their cached workspace matches; entries cached without one count as default. Filters (status, triggerType, from/to, q, workflowId) apply to Postgres and to the merged Redis entries with the same predicate, and to every page of the cursor. A bad filter value is a 400. Viewers get each row with triggerData: { redacted: true } and redacted: true (G32: no message content). Rate limited: 60 req / 60 s.

Auth: Bearer token (how to get one) · Operation: listExecutions

Parameters

NameInTypeDescription
limitqueryinteger

Maximum number of results to return per page.

cursorquerystring

Opaque cursor from a previous response nextCursor field.

workflowIdquerystring

Only this workflow's executions.

statusquerystring

Comma list of statuses: pending, running, completed, failed, partial, cancelled.

triggerTypequerystring

Comma list of trigger types: mllp, webhook, x12, fhir-subscription, polling, cron, schedule, manual, replay.

fromquerystring (date-time)

Started at or after (ISO-8601 date-time with an offset or Z).

toquerystring (date-time)

Started at or before. Not before from, at most 5 minutes in the future.

qquerystring

Execution id prefix, or text in the workflow name or error (case-insensitive). Never searches trigger data (message bodies are PHI; search them in Messages). Without from, covers the last 90 days.

Responses

  • 200Paginated list of executions.
    Response fields

    application/json · object

    • totalintegerrequired

      Number of items returned in this page.

    • nextCursorstring | nullrequired

      Pass this value as cursor to retrieve the next page, or null if this is the last page.

    • executionsarray of Executionrequired
  • 401Missing or invalid JWT Bearer token.

    application/json · ApiError

  • 429Rate limit exceeded.

    application/json · ApiError

  • 500Unexpected server error.

    application/json · ApiError

Example request

curl
curl "$ENGINE_URL/api/executions" \
  -H "Authorization: Bearer $TOKEN"

Get execution

get/api/executions/{id}

The execution with its per-node results. Workspace-scoped (404 elsewhere) and audited as execution.viewed; a signed-in person's raw read (no view=masked, no reveal) also writes message.viewed with the patient's keyed hash and raw: true, while an API client's read is audited as before. Viewers never see message content (G32): triggerData is { redacted: true }, every node result's data is null, redacted is true, and the audit row carries redacted: true; status, timings and errors stay. The builder's recorded run reads it with view=masked: trigger data, node input/output and errors masked (phiMasked: true), console lines withheld. phi=reveal&reason= serves it as stored after writing phi.revealed (the reason, the patient's keyed hash, part: "run"); a viewer's reveal is 403 PHI_REVEAL_FORBIDDEN, an unknown reason 400, and a reveal that can't be recorded serves nothing (500 PHI_REVEAL_NOT_RECORDED). Without either the answer is unchanged.

Auth: Bearer token (how to get one) · Operation: getExecution

Parameters

NameInTypeDescription
idrequiredpathstring

Execution ID.

viewquerystring

masked: the builder's masked view of the run.

phiquerystring

reveal to get PHI unmasked. Operators and admins only (a viewer gets 403 PHI_REVEAL_FORBIDDEN); needs reason. The read is audited as phi.revealed with the reason and a keyed hash per patient, never a value.

reasonquerystring

Why PHI is shown, with phi=reveal. Anything else is a 400.

grantquerystring

With phi=reveal: the id of the caller's open reveal window (POST /api/phi/reveal-grant), used instead of asking for a reason on each view. Checked on every request: a window that ended, expired, or belongs to someone else or another workspace is 403 PHI_REVEAL_GRANT_ENDED and nothing is shown. The read is audited as phi.revealed with the window's reason and grantId.

Responses

  • 200Execution detail with per-node results.
    Response fields

    application/json · object

  • 401Missing or invalid JWT Bearer token.

    application/json · ApiError

  • 404The requested resource was not found.

    application/json · ApiError

  • 429Rate limit exceeded.

    application/json · ApiError

  • 500Unexpected server error.

    application/json · ApiError

Example request

curl
curl "$ENGINE_URL/api/executions/exec_xyz789" \
  -H "Authorization: Bearer $TOKEN"

Replay execution

post/api/executions/{id}/replay

Re-run a workflow with the same trigger payload as the original execution. The run uses the deployed version of the workflow, which must be enabled. A fresh execution is created as pending and runs asynchronously; the 202 response names it (newExecutionId). In an ordered lane (MLLP, or a trigger with ordering: fifo) the replay keeps the original message's place: it runs before newer messages still waiting in the lane. In a lane held after a failure (onError: hold), a replay of the held message runs and releases the lane when it succeeds; a replay of any other message waits behind the hold. Needs a valid license. Rate limited to 10 requests per minute.

Which destinations re-run. A workflow with a router sends to several destinations. With no scope in the body, a partial execution re-runs only the destinations that failed, a replay that was itself targeted re-runs the same set, and anything else re-runs every destination. A destination that another attempt of the same message already delivered is never sent again. destinationIds names the destinations yourself. allDestinations: true resends to all of them.

Refusals. The code tells you why: NOT_FOUND (404), WORKFLOW_DISABLED (403), IN_PROGRESS and RETRY_SCHEDULED (409: an attempt is still running, or a retry is waiting), ALREADY_DELIVERED (409: every destination already received it), NO_FAILED_DESTINATION (409), CHAIN_TOO_DEEP (409), CONFLICTING_SCOPE (400: both scopes given), INVALID_REQUEST (400), UNKNOWN_DESTINATION (400), NO_DESTINATIONS (400), NOT_A_MESSAGE (400: a stored message is needed to target destinations) STALE_SCOPE (400: the recorded scope names a destination that no longer exists) and MASKED_INPUT (400: modifyInput holds masked PHI (•••) that the stored message did not, so it was edited from a masked screen; reveal PHI and edit the message as received).

Stored trigger headers keep their names, and credential values are masked.

Auth: Bearer token (how to get one) · Operation: replayExecution

Parameters

NameInTypeDescription
idrequiredpathstring

Execution ID.

Request body

application/json · object

  • modifyInputobject

    Fields merged over the original trigger input for this replay. Refused with 400 MASKED_INPUT when it holds more masked values (•••) than the stored message.

  • destinationIdsarray of string

    Re-run only these channel destinations (router edge ids). Unknown ids are refused with 400.

  • allDestinationsboolean

    Resend to every destination, not only the failed ones. Not combinable with destinationIds.

Responses

  • 202Replay started.
    Response fields

    application/json · object

    • newExecutionIdstringrequired
    • workflowIdstringrequired
    • originalExecutionIdstringrequired
    • destinationIdsarray of string | null

      The destinations that re-run. null means every destination.

  • 401Missing or invalid JWT Bearer token.

    application/json · ApiError

  • 404Not found in the caller's workspace (it may exist in another workspace).

    application/json · ApiError

  • 429Rate limit exceeded.

    application/json · ApiError

  • 500Unexpected server error.

    application/json · ApiError

Example request

curl
curl -X POST "$ENGINE_URL/api/executions/exec_xyz789/replay" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "modifyInput": {},
  "destinationIds": [
    "string"
  ],
  "allDestinations": true
}'

Cancel execution

post/api/executions/{id}/cancel

Cancels a pending or running execution. pending → 200 cancelled: the row is cancelled at once and never runs. running (or failed with an automatic workflow retry scheduled) → 202 cancelling: the cancel is stored on the execution and reaches the replica running it within one heartbeat interval; the run stops before its next step (a retry backoff ends at once, no further attempt is made) and ends cancelled. A send already in flight completes and its outcome is recorded. The id of an earlier workflow-retry attempt acts on the run's newest attempt: the cancel is stored there, and a run whose newest attempt has finished (a retry completed, or the retries ran out) is a 400. Any other status, or a run that finished meanwhile, is a 400 (Cannot cancel execution with status: ...). Rate limited to 10 requests per minute.

Auth: Bearer token (how to get one) · Operation: cancelExecution

Parameters

NameInTypeDescription
idrequiredpathstring

Execution ID.

Responses

  • 200A pending execution was cancelled.
    Response fields

    application/json · object

    • successbooleanrequired
    • executionIdstringrequired
    • statusstringrequired

      One of: "cancelled"

    • cancelledAtstring (date-time)
  • 202Cancel requested for a running execution; it ends `cancelled` before its next step.
    Response fields

    application/json · object

    • successbooleanrequired
    • executionIdstringrequired
    • statusstringrequired

      One of: "cancelling"

    • requestedAtstring (date-time)
  • 400Request body or query parameters failed validation.

    application/json · ApiError

  • 401Missing or invalid JWT Bearer token.

    application/json · ApiError

  • 404The requested resource was not found.

    application/json · ApiError

  • 429Rate limit exceeded.

    application/json · ApiError

  • 500Unexpected server error.

    application/json · ApiError

Example request

curl
curl -X POST "$ENGINE_URL/api/executions/exec_xyz789/cancel" \
  -H "Authorization: Bearer $TOKEN"

Get execution logs

get/api/executions/{id}/logs

One log line per node result, in start order. Node payloads are never returned. Workspace-scoped (404 elsewhere) and audited as execution.viewed (with redacted: true for a viewer).

Auth: Bearer token (how to get one) · Operation: getExecutionLogs

Parameters

NameInTypeDescription
idrequiredpathstring

Execution ID.

Responses

  • 200Structured log entries for the execution.
    Response fields

    application/json · object

    • executionIdstringrequired
    • statusstring | nullrequired
    • totalNodesintegerrequired
    • successfulNodesintegerrequired
    • failedNodesintegerrequired
    • logsarray of objectrequired
      10 fields
      • timestampstring (date-time)required
      • levelstringrequired

        One of: "info", "warn", "error"

      • messagestringrequired
      • nodeIdstringrequired
      • nodeNamestring
      • statusstringrequired
      • startedAtstring (date-time)required
      • completedAtstring (date-time) | null
      • durationinteger | null

        Milliseconds

      • errorstring | null
  • 401Missing or invalid JWT Bearer token.

    application/json · ApiError

  • 404The requested resource was not found.

    application/json · ApiError

  • 429Rate limit exceeded.

    application/json · ApiError

  • 500Unexpected server error.

    application/json · ApiError

Example request

curl
curl "$ENGINE_URL/api/executions/exec_xyz789/logs" \
  -H "Authorization: Bearer $TOKEN"

Stream execution events (SSE)

get/api/executions/{id}/stream

Opens a Server-Sent Events stream that emits per-node status updates every 500 ms until the execution reaches a terminal state. Viewers get each update without trigger data or node output (G32), like GET /api/executions/{id}. Because browser EventSource cannot set custom headers, the JWT must be passed as the token query parameter rather than the Authorization header.

Auth: None, public route · Operation: streamExecution

Parameters

NameInTypeDescription
idrequiredpathstring

Execution ID.

tokenrequiredquerystring

JWT Bearer token (used in place of Authorization header for SSE).

Responses

  • 200SSE event stream.

    text/event-stream · string

  • 404The requested resource was not found.

    application/json · ApiError

  • 429Rate limit exceeded.

    application/json · ApiError

  • 500Unexpected server error.

    application/json · ApiError

Example request

curl
curl "$ENGINE_URL/api/executions/exec_xyz789/stream?token=string"

List batch reads

get/api/batch-runs

This workspace's batch reads, newest first (at most 50), with their progress. No row content.

Minimum role: viewer.

Auth: Bearer token (how to get one) · Operation: listBatchRuns

Responses

  • 200The batches.
    Response fields

    application/json · object

    • batchesarray of object
      19 fields
      • idstring
      • workflowIdstring
      • workflowNamestring
      • adapterProfileIdstring
      • statusstring

        running: reading chunks as the backlog allows (with lastError set, retrying a transient read failure after a back-off). paused: no chunk is read (queued rows still run). completed: every row is queued. cancelled: reading stopped. failed: a read failed in a way a retry will not fix (lastError says why); resume it once fixed.

        One of: "running", "paused", "completed", "cancelled", "failed"

      • chunkSizeinteger

        Rows read per chunk.

      • maxBackloginteger

        The workflow's pending backlog never passes this; the next chunk is read at or below maxBacklog - chunkSize.

      • rowsReadinteger

        Rows read and queued so far.

      • totalRowsinteger | null

        The result's row count, when the source reports it.

      • queuedinteger

        Row runs waiting to run.

      • runninginteger
      • doneinteger

        Row runs that completed.

      • failedinteger

        Row run attempts that failed.

      • cancelledinteger
      • lastErrorstring | null

        The last read failure: an error code and a summary with anything the source sent withheld.

      • readAttemptsinteger

        Transient read failures of the current chunk in a row (0 once a chunk is read). The wait doubles after each, from 30 s up to 15 min; the 8th fails the batch.

      • createdAtstring (date-time)
      • updatedAtstring (date-time)
      • completedAtstring (date-time) | null
  • 401No credential, or the token is invalid or expired.

    application/json · ApiError

  • 429Rate limit exceeded (see the `Retry-After` header), or on the AI routes the daily AI budget is used up.

    application/json · ApiError

  • 500Unexpected server error.

    application/json · ApiError

Example request

curl
curl "$ENGINE_URL/api/batch-runs" \
  -H "Authorization: Bearer $TOKEN"

Start a batch read

post/api/batch-runs

Reads a large BigQuery query (one job, page by page) or SQL SELECT (keyset: the statement binds :after and :limit and orders by keyColumn, starting after keyInitial) or a CSV file over SFTP (streamed from the byte offset of the next unread record; a file whose size or modified time changes mid-batch fails it) or a paginated Generic REST GET (every pagination mode, read to the last page; the checkpoint is the next page's position, never a credential or a query value) in chunks, and queues each row as one run of the workflow, input {triggerType: "batch", batchId, rowIndex, row}. The next chunk is read only once the workflow's pending backlog is at or below maxBacklog - chunkSize; each chunk's row runs and the read's checkpoint are stored together, so a restart resumes where it stopped and every row runs once. A transient read failure (a rate limit, a 5xx, a dropped connection) is retried from the checkpoint with a doubling back-off (30 s, 1 min, 2 min, ... at most 15 min); after 8 failed attempts in a row, or on any other failure, the batch is failed and can be resumed from its checkpoint. 409 while the workflow has another running or paused batch. The workflow must be on; the license and PHI checks are a manual run's (403 PHI_NOT_AUTHORIZED from the license, 403 PHI_IN_SANDBOX in a sandbox workspace that blocks real PHI). Audited as batch.started. Rate limited: 10 req / 60 s.

Minimum role: operator.

Auth: Bearer token (how to get one) · Operation: startBatchRun

Request body (required)

application/json · object

  • workflowIdstringrequired
  • adapterProfileIdstringrequired

    A BigQuery, SQL database, SFTP or Generic REST profile.

  • paramsobjectrequired

    BigQuery: the query step's params (sql, params, paramTypes). SQL database: sql, keyColumn, keyInitial, optional params. SFTP: remotePath, optional csv (csv-parse options: delimiter, quote, escape, header, columns, skipLines, trim, skipEmpty, strictColumns, recordDelimiter) and encoding (utf8 or latin1). Generic REST: endpoint or urlTemplate, optional query and headers, and pagination (required; the read step's settings, maxPages and maxItems ignored); 400 without it.

  • chunkSizeinteger

    Default 1000, at most 10000.

  • maxBackloginteger

    Default five chunks, at most half of WORKFLOW_MAX_PENDING; at least chunkSize, at most WORKFLOW_MAX_PENDING - chunkSize, so intake keeps a chunk's room.

Responses

  • 201Started.
    Response fields

    application/json · object

    • batchobject
      19 fields
      • idstring
      • workflowIdstring
      • workflowNamestring
      • adapterProfileIdstring
      • statusstring

        running: reading chunks as the backlog allows (with lastError set, retrying a transient read failure after a back-off). paused: no chunk is read (queued rows still run). completed: every row is queued. cancelled: reading stopped. failed: a read failed in a way a retry will not fix (lastError says why); resume it once fixed.

        One of: "running", "paused", "completed", "cancelled", "failed"

      • chunkSizeinteger

        Rows read per chunk.

      • maxBackloginteger

        The workflow's pending backlog never passes this; the next chunk is read at or below maxBacklog - chunkSize.

      • rowsReadinteger

        Rows read and queued so far.

      • totalRowsinteger | null

        The result's row count, when the source reports it.

      • queuedinteger

        Row runs waiting to run.

      • runninginteger
      • doneinteger

        Row runs that completed.

      • failedinteger

        Row run attempts that failed.

      • cancelledinteger
      • lastErrorstring | null

        The last read failure: an error code and a summary with anything the source sent withheld.

      • readAttemptsinteger

        Transient read failures of the current chunk in a row (0 once a chunk is read). The wait doubles after each, from 30 s up to 15 min; the 8th fails the batch.

      • createdAtstring (date-time)
      • updatedAtstring (date-time)
      • completedAtstring (date-time) | null
  • 400The request is malformed or fails validation.

    application/json · ApiError

  • 401No credential, or the token is invalid or expired.

    application/json · ApiError

  • 403The caller's role, license or network address does not allow this. A signed-in person who is not a member of the requested workspace gets code `WORKSPACE_FORBIDDEN`; a viewer asking for message content gets `PHI_FORBIDDEN` (or `PHI_SEARCH_FORBIDDEN` for a search on message content).

    application/json · ApiError

  • 404Not found in the caller's workspace.

    application/json · ApiError

  • 409The request conflicts with the current state.

    application/json · ApiError

  • 429Rate limit exceeded (see the `Retry-After` header), or on the AI routes the daily AI budget is used up.

    application/json · ApiError

  • 500Unexpected server error.

    application/json · ApiError

Example request

curl
curl -X POST "$ENGINE_URL/api/batch-runs" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "workflowId": "string",
  "adapterProfileId": "string",
  "params": {},
  "chunkSize": 0,
  "maxBacklog": 0
}'

Get a batch read

get/api/batch-runs/{id}

One batch read with its progress. No row content.

Minimum role: viewer.

Auth: Bearer token (how to get one) · Operation: getBatchRun

Parameters

NameInTypeDescription
idrequiredpathstring

The batch id.

Responses

  • 200The batch.
    Response fields

    application/json · object

    • batchobject
      19 fields
      • idstring
      • workflowIdstring
      • workflowNamestring
      • adapterProfileIdstring
      • statusstring

        running: reading chunks as the backlog allows (with lastError set, retrying a transient read failure after a back-off). paused: no chunk is read (queued rows still run). completed: every row is queued. cancelled: reading stopped. failed: a read failed in a way a retry will not fix (lastError says why); resume it once fixed.

        One of: "running", "paused", "completed", "cancelled", "failed"

      • chunkSizeinteger

        Rows read per chunk.

      • maxBackloginteger

        The workflow's pending backlog never passes this; the next chunk is read at or below maxBacklog - chunkSize.

      • rowsReadinteger

        Rows read and queued so far.

      • totalRowsinteger | null

        The result's row count, when the source reports it.

      • queuedinteger

        Row runs waiting to run.

      • runninginteger
      • doneinteger

        Row runs that completed.

      • failedinteger

        Row run attempts that failed.

      • cancelledinteger
      • lastErrorstring | null

        The last read failure: an error code and a summary with anything the source sent withheld.

      • readAttemptsinteger

        Transient read failures of the current chunk in a row (0 once a chunk is read). The wait doubles after each, from 30 s up to 15 min; the 8th fails the batch.

      • createdAtstring (date-time)
      • updatedAtstring (date-time)
      • completedAtstring (date-time) | null
  • 401No credential, or the token is invalid or expired.

    application/json · ApiError

  • 404Not found in the caller's workspace.

    application/json · ApiError

  • 429Rate limit exceeded (see the `Retry-After` header), or on the AI routes the daily AI budget is used up.

    application/json · ApiError

  • 500Unexpected server error.

    application/json · ApiError

Example request

curl
curl "$ENGINE_URL/api/batch-runs/<id>" \
  -H "Authorization: Bearer $TOKEN"

Pause, resume or cancel a batch read

post/api/batch-runs/{id}/{action}

pause: no more chunks are read (rows already queued still run). resume: a paused or failed batch reads on from the stored checkpoint (rows already queued are not queued again); the optional body {chunkSize} may lower the chunk size (400 when larger than the batch's); 409 while another batch of the workflow is running or paused. cancel: reading stops and the queued rows are cancelled. pause and cancel take no body. Audited as batch.paused, batch.resumed or batch.cancelled. Rate limited: 30 req / 60 s.

Minimum role: operator.

Auth: Bearer token (how to get one) · Operation: changeBatchRun

Parameters

NameInTypeDescription
idrequiredpathstring

The batch id.

actionrequiredpathstring

pause, resume or cancel.

Request body

application/json · object

  • chunkSizeinteger

    resume only: a smaller chunk size, at least 1.

Responses

  • 200Done. `changed` is false when the batch was not in a state the action applies to.
    Response fields

    application/json · object

    • changedboolean
    • batchobject
      19 fields
      • idstring
      • workflowIdstring
      • workflowNamestring
      • adapterProfileIdstring
      • statusstring

        running: reading chunks as the backlog allows (with lastError set, retrying a transient read failure after a back-off). paused: no chunk is read (queued rows still run). completed: every row is queued. cancelled: reading stopped. failed: a read failed in a way a retry will not fix (lastError says why); resume it once fixed.

        One of: "running", "paused", "completed", "cancelled", "failed"

      • chunkSizeinteger

        Rows read per chunk.

      • maxBackloginteger

        The workflow's pending backlog never passes this; the next chunk is read at or below maxBacklog - chunkSize.

      • rowsReadinteger

        Rows read and queued so far.

      • totalRowsinteger | null

        The result's row count, when the source reports it.

      • queuedinteger

        Row runs waiting to run.

      • runninginteger
      • doneinteger

        Row runs that completed.

      • failedinteger

        Row run attempts that failed.

      • cancelledinteger
      • lastErrorstring | null

        The last read failure: an error code and a summary with anything the source sent withheld.

      • readAttemptsinteger

        Transient read failures of the current chunk in a row (0 once a chunk is read). The wait doubles after each, from 30 s up to 15 min; the 8th fails the batch.

      • createdAtstring (date-time)
      • updatedAtstring (date-time)
      • completedAtstring (date-time) | null
  • 400The request is malformed or fails validation.

    application/json · ApiError

  • 401No credential, or the token is invalid or expired.

    application/json · ApiError

  • 404Not found in the caller's workspace.

    application/json · ApiError

  • 409The request conflicts with the current state.

    application/json · ApiError

  • 429Rate limit exceeded (see the `Retry-After` header), or on the AI routes the daily AI budget is used up.

    application/json · ApiError

  • 500Unexpected server error.

    application/json · ApiError

Example request

curl
curl -X POST "$ENGINE_URL/api/batch-runs/<id>/<action>" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "chunkSize": 0
}'

List the execution archive

get/api/execution-archive

Manifests of the archives execution retention wrote before deleting expired executions (EXECUTION_ARCHIVE_DIR), newest first: id, size, SHA-256, counts, dates, workspaces and the key id. Never message content. configured: false when no archive is set up. With executionId, only the archives that hold it.

Minimum role: admin.

Auth: Bearer token (how to get one) · Operation: listExecutionArchives

Parameters

NameInTypeDescription
executionIdquerystring

An execution id: only the archive(s) holding it.

Responses

  • 200The archives.

    application/json · object

  • 401No credential, or the token is invalid or expired.

    application/json · ApiError

  • 403The caller's role, license or network address does not allow this. A signed-in person who is not a member of the requested workspace gets code `WORKSPACE_FORBIDDEN`; a viewer asking for message content gets `PHI_FORBIDDEN` (or `PHI_SEARCH_FORBIDDEN` for a search on message content).

    application/json · ApiError

  • 500Unexpected server error.

    application/json · ApiError

Example request

curl
curl "$ENGINE_URL/api/execution-archive" \
  -H "Authorization: Bearer $TOKEN"

Read one archived execution

get/api/execution-archive/{id}

Checks the archive object against its manifest (size and SHA-256), then returns one execution and its step results with message content decrypted by the engine's message keys. Returns PHI: every read is audited as execution.archive_read. 409 when the object no longer matches its manifest.

Minimum role: admin.

Auth: Bearer token (how to get one) · Operation: readArchivedExecution

Parameters

NameInTypeDescription
idrequiredpathstring

Archive id (executions-<time>-<hex>).

executionIdrequiredquerystring

An execution id: only the archive(s) holding it.

Responses

  • 200The execution, its step results and the manifest.

    application/json · object

  • 400The request is malformed or fails validation.

    application/json · ApiError

  • 401No credential, or the token is invalid or expired.

    application/json · ApiError

  • 403The caller's role, license or network address does not allow this. A signed-in person who is not a member of the requested workspace gets code `WORKSPACE_FORBIDDEN`; a viewer asking for message content gets `PHI_FORBIDDEN` (or `PHI_SEARCH_FORBIDDEN` for a search on message content).

    application/json · ApiError

  • 404Not found in the caller's workspace.

    application/json · ApiError

  • 409The request conflicts with the current state.

    application/json · ApiError

  • 500Unexpected server error.

    application/json · ApiError

Example request

curl
curl "$ENGINE_URL/api/execution-archive/<id>?executionId=string" \
  -H "Authorization: Bearer $TOKEN"

Schemas

Named objects the operations above link to.

ApiError

The error body. error is always present. code is present on most errors and is the field to branch on; a few routes and the sign-in and role checks return only error (and sometimes detail).

  • errorstringrequired

    Human-readable error message.

  • codestring

    Machine-readable error code.

    One of: "BAD_REQUEST", "INVALID_REQUEST", "UNAUTHORIZED", "UNAUTHENTICATED", "FORBIDDEN", "NOT_FOUND", "CONFLICT", "UNPROCESSABLE_ENTITY", "RATE_LIMITED", "INTERNAL_ERROR", "SERVICE_UNAVAILABLE", "NOT_CONFIGURED", "SIGNATURE_REQUIRED", "INVALID_SIGNATURE", "TIMESTAMP_REQUIRED", "TIMESTAMP_INVALID", "TIMESTAMP_OUT_OF_TOLERANCE", "INVALID_CREDENTIALS", "INVALID_TOKEN", "PAYLOAD_TOO_LARGE", "INVALID_NDJSON", "PHI_NOT_AUTHORIZED", "PHI_IN_SANDBOX", "IN_PROGRESS", "RETRY_SCHEDULED", "WORKFLOW_DISABLED", "CONFLICTING_SCOPE", "ALREADY_DELIVERED", "CHAIN_TOO_DEEP", "NO_FAILED_DESTINATION", "STALE_SCOPE", "UNKNOWN_DESTINATION", "NO_DESTINATIONS", "NOT_A_MESSAGE", "AI_FEATURES_DISABLED"

  • detailsany

    Optional structured context about the error.

CursorPage

  • totalintegerrequired

    Number of items returned in this page.

  • nextCursorstring | nullrequired

    Pass this value as cursor to retrieve the next page, or null if this is the last page.

Execution

  • idstringrequired
  • graphIdstringrequired

    ID of the workflow (WorkflowGraph) this execution belongs to.

  • graphNamestring
  • statusstringrequired

    One of: "pending", "running", "completed", "partial", "failed", "cancelled", "waiting", "held_for_deploy", "filtered"

  • startedAtstring (date-time)required
  • completedAtstring (date-time)
  • durationnumber

    Wall-clock duration in seconds.

  • nodeResultsmap of NodeResult

    Map of node ID to its execution result. For a viewer every result's data is null (G32).

  • currentNodeIdstring
  • errorstring
  • inputany

    Input payload passed to the execution.

  • triggeredBystring
  • triggerDataany

    Raw trigger payload (credentials masked). Message content (PHI): a viewer gets { redacted: true } instead (G32).

  • redactedboolean

    True when the caller is a viewer and the trigger data and node output were removed (G32).

NodeResult

  • nodeIdstringrequired
  • nodeNamestringrequired
  • statusstringrequired

    One of: "pending", "running", "completed", "partial", "failed", "cancelled", "waiting", "held_for_deploy", "filtered"

  • startedAtstring (date-time)required
  • completedAtstring (date-time)
  • durationnumber

    Duration in milliseconds.

  • dataany

    Output data produced by this node. A run stores an output once: an output equal to the run input or to an earlier step's is read back as that value. An output over EXECUTION_NODE_RESULT_MAX_BYTES is { __truncated: { bytes, sha256 } } (see dataTruncated).

  • dataTruncatedboolean

    The output was over EXECUTION_NODE_RESULT_MAX_BYTES (default 10 MiB), so only its size and sha256 were stored. The next step still received the full value; replay the message to run it again.

  • errorstring
  • retryCountinteger
  • diagnosticsobject | null

    What the step reported without failing (node_results.diagnostics). warnings name rows, paths and tables, never values, and are returned to viewers; logs (a JavaScript step's captured console, at most 100 lines of 1 KB) and vars (its channel map) can quote the message and are dropped for viewers (G32).

    3 fields
    • warningsarray of string
    • logsarray of string
    • varsobject