Skip to content
Engine API

Workflows

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

On this page

Create, read, update, delete, and execute DAG-based workflows.

List workflows

get/api/workflows

Returns a cursor-paginated list of workflow definitions for the current workspace. Results are ordered by (name asc, id asc). total counts every match across pages. Rate limited: 300 req / 60 s.

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

Parameters

NameInTypeDescription
limitqueryinteger

Maximum number of results to return per page.

cursorquerystring

Opaque cursor from a previous response nextCursor field.

enabledqueryboolean

Filter by enabled status.

qquerystring

Case-insensitive match on name or description.

triggerquerystring

Comma-separated trigger types, e.g. mllp,webhook. Unknown types return 400.

statsquerystring

1 adds stats: { last24h: { total, failed }, lastRun: { status, startedAt } | null, hourly24: number[24], p95Ms: number | null } and summary to each workflow, and counts to the response.

statusquerystring

The list's chips, applied server-side across pages: attention is failing, unapproved and waiting workflows; active, draft and paused are only that status. Unknown values return 400.

exportablequerystring

1 lists only what Migration › Export to Mirth offers: workflows deployed at least once (no drafts, none needing approval), leaving out MLLP workflows that are on while their tunnel is down (waiting for a first message). Paused and failing workflows stay. Reads no executions.

Responses

  • 200Paginated list of workflows.
    Response fields

    application/json · object

    • totalintegerrequired

      Matching workflows across all pages.

    • nextCursorstring | nullrequired

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

    • workflowsarray of objectrequired
      20 fields
      • idstringrequired
      • namestringrequired
      • descriptionstring
      • enabledbooleanrequired
      • nodesarray of WorkflowNoderequired
      • edgesarray of WorkflowEdgerequired
      • startNodeIdstringrequired
      • triggerobject | object | object | object | object | object | object | object | object | object | object | object | objectrequired

        One of eight supported trigger types. The type discriminant selects the applicable additional fields.

        13 fields
        • type: "manual"object
          1 field
          • typestringrequired

            One of: "manual"

        • type: "topic"object

          Runs once for every event a Publish step writes to the topic (same workspace). Durable fan-out through the work table, at least once, deduplicated by event id.

          2 fields
          • typestringrequired

            One of: "topic"

          • topicstringrequired
        • type: "webhook"object
          13 fields
          • typestringrequired

            One of: "webhook"

          • webhookIdstringrequired
          • pathstring
          • splitBatchesboolean

            Split an HL7 v2 batch (FHS/BHS ... BTS/FTS, or several MSH segments in one delivery) into one run per message, in batch order, each deduplicated on its own MSH-10.

          • charsetstring

            How the received bytes are decoded before parsing. Omitted: UTF-8 (or the Content-Type charset parameter). msh-18: the message's MSH-18 (8859/1, UNICODE UTF-8, ASCII), UTF-8 when it is empty or unknown.

            One of: "utf-8", "iso-8859-1", "windows-1252", "ascii", "msh-18"

          • secretstring
          • timestampToleranceSecondsinteger

            Replay window: the most seconds a signed timestamp (webhook-timestamp or x-webhook-timestamp) may be from the engine's clock. Outside it the answer is 401 TIMESTAMP_OUT_OF_TOLERANCE.

          • requireTimestampboolean

            Refuse a valid signature that carries no signed timestamp (401 TIMESTAMP_REQUIRED). Off: senders that sign the body only keep working.

          • expectedHeadersmap of string
          • bodySchemaobject

            JSON Schema the body must match: type, properties, required, additionalProperties (boolean), items, enum, const, minLength, maxLength, pattern, format (date, date-time, email, uuid), minimum, maximum, minItems, maxItems; $schema, title and description are allowed and not checked; $defs at the root and $ref to #/$defs/<name>. Other keywords are refused on save. A pasted OpenAPI requestBody (with its components) or document ({ document, operationId }) is stored converted to this subset. A body that no trigger on the webhook id accepts is 400 BODY_SCHEMA_INVALID with problems (JSON Pointers, never values), and nothing runs.

          • senderFromobject

            Where a JSON delivery names its sender, for the workflow's sender table ({{sender.KEY}}, per-sender connections): exactly one of path (a dotted path into the body, e.g. organization.id) or header (a header name). The value is matched like an HL7 message's MSH-4.

            2 fields
            • pathstring
            • headerstring
          • orderingstring

            fifo: deliveries run one at a time in arrival order, across every engine replica (an ordering lane per trigger). none: they run in parallel.

            One of: "none", "fifo"

          • onErrorstring

            With ordering fifo. continue: a failed message is reported and the next one runs. hold: a failed message stops its lane; only its own retries and replays run until one succeeds, or the message is discarded from the ACK queue.

            One of: "continue", "hold"

        • type: "schedule"object
          3 fields
          • typestringrequired

            One of: "schedule"

          • cronstringrequired

            Cron expression; an alias of the cron trigger, run once per slot across replicas.

          • timezonestring
        • type: "cron"object
          3 fields
          • typestringrequired

            One of: "cron"

          • cronExpressionstringrequired
          • timezonestring
        • type: "polling"object
          12 fields
          • typestringrequired

            One of: "polling"

          • intervalintegerrequired

            Poll interval in milliseconds (at least 10000).

          • adapterProfileIdstringrequired

            Adapter profile to read; must be in the workflow's workspace.

          • actionstring

            Adapter action to call. Default: search when the adapter has it (FHIR adapters, whose read is read-by-id), otherwise read.

          • paramsobject

            Adapter params. A string value containing {{cursor}} gets the stored cursor; before the first cursor such a value is left out.

          • itemsPathstring

            Dot path to the item array in the adapter result. Not needed for an array or a FHIR Bundle.

          • idFieldstring

            Dot path to each item's id. With cursorField, the dedup key is the id plus its cursor value, so a later change to the same record runs again.

          • cursorFieldstring

            Dot path to an ordered change marker (ISO timestamp or number). Without it, the last 5,000 ids seen are the replay guard.

          • cursorFormatstring

            How cursorField values are written when they do not sort as text (MM/DD/YYYY). Each value is read in this format and stored as ISO-8601; {{cursor}} is sent back in it. A value that does not parse does not run. Changing it starts the cursor again.

            One of: "MM/DD/YYYY", "MM/DD/YYYY HH:mm", "MM/DD/YYYY HH:mm:ss", "MM/DD/YYYY hh:mm A", "MM/DD/YYYY hh:mm:ss A", "DD/MM/YYYY", "DD/MM/YYYY HH:mm:ss", "YYYYMMDDHHmmss", "epoch-seconds", "epoch-millis"

          • maxItemsPerPollinteger

            Items one poll runs. Items sharing the last item's cursor value also run, so a group is never split.

          • filterobject

            Inbound filter ({ logic, rules, groups?, customScript? }), as on the other triggers. A polled item it rejects runs no workflow and creates no work row, but the cursor moves past it, so it is not read again.

          • startFromstring

            now: the first poll records what already exists and runs nothing. beginning: the first poll runs every item.

            One of: "now", "beginning"

        • type: "mllp"object
          13 fields
          • typestringrequired

            One of: "mllp"

          • messageTypesarray of stringrequired
          • sendingFacilitystring
          • sendingAppstring
          • splitBatchesboolean

            Split an HL7 v2 batch (FHS/BHS ... BTS/FTS, or several MSH segments in one delivery) into one run per message, in batch order, each deduplicated on its own MSH-10.

          • charsetstring

            How the received bytes are decoded before parsing. Omitted: UTF-8. msh-18: the message's MSH-18 (8859/1, UNICODE UTF-8, ASCII), UTF-8 when it is empty or unknown.

            One of: "utf-8", "iso-8859-1", "windows-1252", "ascii", "msh-18"

          • listenerstring

            The MLLP listener (port) this trigger takes messages from, declared in Helm mllp.listeners. Omitted: default (mllp.port). A save naming an undeclared listener is a 400.

          • ackModestring

            accept: AA once the message is durably recorded. respond (#751): waits like destination, then answers with the ACK the workflow's Respond step built (a custom MSA and ERR segments, or a whole ACK); with no usable Respond output, the destination-mode outcome; when the wait runs out, ackTimeoutCode. destination: the ACK waits for the workflow's destinations: AA when every one completed, AR when one rejected it for good, AE on any other failure or when they have not finished within ackTimeoutMs. A resend of a message whose delivery failed replays it once and waits again. Not used for messages from an msh15 listener that set MSH-15.

            One of: "accept", "destination", "respond"

          • ackTimeoutMsinteger

            destination and respond modes: how long the ACK waits, capped at the listener's MLLP_TIMEOUT minus 5 s. One sender connection handles one message at a time, so a slow destination slows that sender (intended backpressure).

          • ackTimeoutCodestring

            respond mode: the ACK sent when the run has not settled within ackTimeoutMs. AE: the sender resends (dedup absorbs it). AR: the sender gives up on the message; the recorded run still runs.

            One of: "AE", "AR"

          • ackOnFailurestring

            respond mode, when a step after the Respond step fails: respond keeps the Respond step's ACK (Mirth's respond from destination); AE answers AE "Workflow failed; retry".

            One of: "respond", "AE"

          • filteredAckstring

            The ACK for a message this trigger's filter drops when no other workflow takes it. AR: "No matching triggers". AA: accepted, as Mirth answers for filtered messages. Either way the message is kept in Messages as Filtered, with the rule that dropped it.

            One of: "AR", "AA"

          • onErrorstring

            Messages always run in arrival order per sending facility (lane <trigger>|<MSH-4>). continue: a failed message is reported and the next one runs. hold: a failed message stops its lane; only its own retries and replays run until one succeeds, or the message is discarded from the ACK queue.

            One of: "continue", "hold"

        • type: "fhir-subscription"object
          6 fields
          • typestringrequired

            One of: "fhir-subscription"

          • resourceTypestringrequired
          • criteriastring
          • interactionstring

            One of: "create", "update", "delete", "create-or-update"

          • orderingstring

            fifo: deliveries run one at a time in arrival order, across every engine replica (an ordering lane per trigger; one lane per resourceType/id). none: they run in parallel.

            One of: "none", "fifo"

          • onErrorstring

            With ordering fifo. continue: a failed message is reported and the next one runs. hold: a failed message stops its lane; only its own retries and replays run until one succeeds, or the message is discarded from the ACK queue.

            One of: "continue", "hold"

        • type: "x12"object
          19 fields
          • typestringrequired

            One of: "x12"

          • transactionSetsarray of stringrequired
          • sourceTypestringrequired

            Which deliveries this trigger takes. The server decides a delivery's source: webhook for POST /api/triggers/x12 with a token, upload for a dashboard upload, sftp for the SFTP pickup. A sender cannot claim one.

            One of: "sftp", "webhook", "upload"

          • sftpProfileIdstring

            sourceType sftp: the SFTP adapter profile whose folder the engine polls for X12 files.

          • pollIntervalinteger

            sourceType sftp: milliseconds between pickups.

          • remotePathstring

            sourceType sftp: the folder to pick files up from.

          • filenamePatternstring

            sourceType sftp: a glob (*, ?, [abc]) on the file name.

          • afterProcessingstring

            sourceType sftp: what happens to a file once its transaction sets are recorded. A file is never run twice, leave included: the engine's record of a file does not expire while the file is in the folder, and deduplicate: false does not turn it off.

            One of: "move", "delete", "leave"

          • processedPathstring

            sourceType sftp: where move puts files (required for move).

          • errorPathstring

            sourceType sftp: where a file that is not X12 goes; without it the file stays and the error is recorded.

          • filenameRegexboolean

            filenamePattern is a regular expression matched against the whole name.

          • minFileAgeMsinteger

            A file modified more recently than this may still be being written and waits for a later pickup.

          • maxFileBytesinteger

            A larger file (by its listed size) is never downloaded: it goes to errorPath (or stays) with a size error.

          • sortBystring

            Pickup order: oldest first, or by name.

            One of: "modified", "name"

          • encodingstring

            How file bytes are decoded (latin1: ISO-8859-1).

            One of: "utf8", "latin1"

          • ackPathstring

            sourceType sftp: where the 999 / TA1 (see acknowledgments) are written, as <file>.999 / <file>.ta1.

          • acknowledgmentsstring

            999: a 999 per functional group comes back with the delivery. 999+ta1: also a TA1 when ISA14=1 or the envelope is broken. Syntax checks only (control numbers and counts, a known ST), not implementation-guide validation.

            One of: "none", "999", "999+ta1"

          • orderingstring

            fifo: deliveries run one at a time in arrival order, across every engine replica (an ordering lane per trigger). none: they run in parallel.

            One of: "none", "fifo"

          • onErrorstring

            With ordering fifo. continue: a failed message is reported and the next one runs. hold: a failed message stops its lane; only its own retries and replays run until one succeeds, or the message is discarded from the ACK queue.

            One of: "continue", "hold"

        • type: "sftp"object

          Picks files up from an SFTP folder (like a Mirth File Reader). A file is downloaded only once it is minFileAgeMs old and its listed size is at most maxFileBytes; it is moved, deleted or left only after its runs are recorded, and never runs twice.

          20 fields
          • typestringrequired

            One of: "sftp"

          • sftpProfileIdstringrequired

            The SFTP adapter profile whose folder the engine polls.

          • minFileBytesinteger

            A smaller file is left in place (Mirth fileSizeMinimum).

          • maxFilesPerPollinteger

            At most this many files per pickup; the rest wait for the next one.

          • recursiveboolean

            Also pick up files in subfolders (at most 10 deep), never in processedPath or errorPath. file.name is relative to remotePath; a moved file lands in processedPath by its own name.

          • ignoreDotboolean

            Skip files and folders whose name starts with a dot.

          • remotePathstringrequired

            The folder to pick files up from.

          • pollIntervalintegerrequired

            Milliseconds between pickups.

          • filenamePatternstring

            A glob (*, ?, [abc]) on the file name.

          • filenameRegexboolean

            filenamePattern is a regular expression matched against the whole name.

          • minFileAgeMsinteger

            A file modified more recently than this may still be being written and waits for a later pickup.

          • maxFileBytesinteger

            A larger file (by its listed size) is never downloaded: it goes to errorPath (or stays) with a size error.

          • sortBystring

            Pickup order: oldest first, by name, or smallest first.

            One of: "modified", "name", "size"

          • encodingstring

            How file bytes are decoded (latin1: ISO-8859-1). binary: the run's content is the bytes as base64, with contentEncoding "base64" (not with batch.mode rows).

            One of: "utf8", "latin1", "windows-1252", "ascii", "utf16le", "binary"

          • afterProcessingstring

            What happens to a file once its runs are recorded. leave: the file stays and never runs again while it is unchanged.

            One of: "move", "delete", "leave"

          • processedPathstring

            Where move puts files (required for move; not remotePath).

          • errorPathstring

            Where a file that is too large, or a CSV that does not parse (rows mode), goes; without it the file stays and the error is recorded.

          • batchobject
            3 fields
            • modestring

              file: one run per file, with { file, content }. rows: one run per CSV row, with { file, row, rowIndex, rowCount }; all rows of a file are recorded together.

              One of: "file", "rows"

            • csvobject

              rows mode: csv-parse options (delimiter, recordDelimiter, quote, escape, header, columns, skipLines, trim, skipEmpty, strictColumns, maxRows at most WORKFLOW_MAX_PENDING).

            • fixedWidthobject

              rows mode, instead of csv: fixed-width-parse options (columns or records, recordDelimiter, recordLength, headerLines, footerLines, unknownRecords, maxRows at most WORKFLOW_MAX_PENDING); one run per record.

          • orderingstring

            fifo: runs execute one at a time in pickup order (files, then rows), across every engine replica.

            One of: "none", "fifo"

          • onErrorstring

            With ordering fifo: what a failed run does to its lane.

            One of: "continue", "hold"

        • type: "file"object

          Picks files up from the folder of a file, ftp, smb, webdav, s3 or sftp adapter profile (a Mirth File Reader over any scheme, P138). Same settings and runs as the sftp trigger; triggerType is "file".

          20 fields
          • typestringrequired

            One of: "file"

          • adapterProfileIdstringrequired

            The adapter profile whose folder the engine polls: its adapter type (file, ftp, smb, webdav, s3 or sftp) is the transport.

          • minFileBytesinteger

            A smaller file is left in place (Mirth fileSizeMinimum).

          • maxFilesPerPollinteger

            At most this many files per pickup; the rest wait for the next one.

          • recursiveboolean

            Also pick up files in subfolders (at most 10 deep), never in processedPath or errorPath. file.name is relative to remotePath; a moved file lands in processedPath by its own name.

          • ignoreDotboolean

            Skip files and folders whose name starts with a dot.

          • remotePathstringrequired

            The folder to pick files up from.

          • pollIntervalintegerrequired

            Milliseconds between pickups.

          • filenamePatternstring

            A glob (*, ?, [abc]) on the file name.

          • filenameRegexboolean

            filenamePattern is a regular expression matched against the whole name.

          • minFileAgeMsinteger

            A file modified more recently than this may still be being written and waits for a later pickup.

          • maxFileBytesinteger

            A larger file (by its listed size) is never downloaded: it goes to errorPath (or stays) with a size error.

          • sortBystring

            Pickup order: oldest first, by name, or smallest first.

            One of: "modified", "name", "size"

          • encodingstring

            How file bytes are decoded (latin1: ISO-8859-1). binary: the run's content is the bytes as base64, with contentEncoding "base64" (not with batch.mode rows).

            One of: "utf8", "latin1", "windows-1252", "ascii", "utf16le", "binary"

          • afterProcessingstring

            What happens to a file once its runs are recorded. leave: the file stays and never runs again while it is unchanged.

            One of: "move", "delete", "leave"

          • processedPathstring

            Where move puts files (required for move; not remotePath).

          • errorPathstring

            Where a file that is too large, or a CSV that does not parse (rows mode), goes; without it the file stays and the error is recorded.

          • batchobject
            3 fields
            • modestring

              file: one run per file, with { file, content }. rows: one run per CSV row, with { file, row, rowIndex, rowCount }; all rows of a file are recorded together.

              One of: "file", "rows"

            • csvobject

              rows mode: csv-parse options (delimiter, recordDelimiter, quote, escape, header, columns, skipLines, trim, skipEmpty, strictColumns, maxRows at most WORKFLOW_MAX_PENDING).

            • fixedWidthobject

              rows mode, instead of csv: fixed-width-parse options (columns or records, recordDelimiter, recordLength, headerLines, footerLines, unknownRecords, maxRows at most WORKFLOW_MAX_PENDING); one run per record.

          • orderingstring

            fifo: runs execute one at a time in pickup order (files, then rows), across every engine replica.

            One of: "none", "fifo"

          • onErrorstring

            With ordering fifo: what a failed run does to its lane.

            One of: "continue", "hold"

        • type: "jms"object

          Consumes a JMS queue or topic over AMQP 1.0 (a Mirth JMS Listener) through a jms adapter profile. One engine replica consumes each trigger. A message is acknowledged to the broker only once its run is recorded, so a crash redelivers it, and the JMS message id dedups the redelivery. A message the filter drops is acknowledged; one that can't be recorded (license, backlog, shutdown) stays on the broker.

          10 fields
          • typestringrequired

            One of: "jms"

          • adapterProfileIdstringrequired

            The jms adapter profile (broker host, login, TLS).

          • destinationstringrequired

            Queue or topic name.

          • destinationTypestring

            One of: "queue", "topic"

          • subscriptionNamestring

            Topics: a durable subscription under this name (the profile's clientId, else medhook-<workflowId>, is its client id), so messages sent while no engine is connected wait for it.

          • selectorstring

            A JMS message selector, applied by the broker.

          • prefetchinteger

            Messages the broker may send ahead of acknowledgement.

          • orderingstring

            One of: "none", "fifo"

          • onErrorstring

            One of: "continue", "hold"

          • deduplicateboolean
        • type: "soap"object

          A SOAP 1.1/1.2 endpoint at /api/triggers/soap/{listenerId} with its WSDL at ?wsdl (a Mirth Web Service Listener).

          15 fields
          • typestringrequired

            One of: "soap"

          • listenerIdstringrequired
          • serviceNamestring

            The generated WSDL's service name.

          • namespacestring

            The generated WSDL's target namespace.

          • soapVersionstring

            One of: "1.1", "1.2", "both"

          • operationsarray of string

            Operation (Body element) names it takes; empty takes any.

          • wsSecuritystring

            One of: "none", "UsernameToken"

          • wsUsernamestring
          • wsPasswordstring

            Write-only: stored encrypted, read back as __set__.

          • secretstring

            HMAC-SHA256 key for x-webhook-signature. Write-only, read back as __set__.

          • wsdlstring

            A WSDL to serve instead of the generated one.

          • responseobject
            3 fields
            • modestring

              One of: "accepted", "destination"

            • nodeIdstring
            • timeoutMsinteger
          • orderingstring

            One of: "none", "fifo"

          • onErrorstring

            One of: "continue", "hold"

          • deduplicateboolean
      • metadataobject

        Arbitrary workflow-level metadata.

        1 field
        • handlesPHIboolean

          When true the engine requires a BAA-enabled license before executing.

      • createdBystring
      • createdAtstring (date-time)
      • updatedAtstring (date-time)
      • ownerstring | null

        Who owns the workflow (Settings · General). Changed with PATCH; null = not set.

      • tagsarray of string

        Lowercased tags (Settings · General). Changed with PATCH.

      • maxInFlightinteger | null

        Most runs of this workflow the work runner starts at once across replicas: queued messages and polls wait while that many run (Settings · Delivery). A manual run is not held back but counts. Changed with PATCH; null = no limit.

      • dedupTtlHoursinteger

        GET only: how long a duplicate receipt is kept (INBOUND_DEDUP_TTL_HOURS, default 24), the Duplicate messages window.

      • maxWorkflowRetriesinteger | null

        Max times to retry the entire workflow after top-level failure. Each retry is a durable pending execution due after the backoff: it survives a restart and holds no queue slot or ordering lane while it waits. Saved with the workflow and its versions; the deployed version's value runs. null = not set (0).

      • workflowRetryDelayMsinteger | null

        Base delay (ms) before the first workflow-level retry; doubles per attempt, capped at 30 minutes.

      • statsobject

        With stats=1. The series and p95 are cached for 60 s; a new run on the page refreshes them.

        4 fields
        • last24hobject
          2 fields
          • totalinteger
          • failedinteger
        • lastRunobject | null
          2 fields
          • statusstring
          • startedAtstring (date-time)
        • hourly24array of integer

          Runs per hour over the last 24 h, 24 entries, oldest first; sums to last24h.total.

        • p95Msinteger | null

          p95 run time over the last 24 h in ms; null when idle.

      • summaryobject

        With stats=1.

        9 fields
        • versioninteger

          Live version number.

        • deployedVersioninteger | null

          Deployed version, null before the first deploy.

        • destinationsarray of string
        • statusstring

          active · unapproved (Needs approval) · failing · waiting (Waiting for first message) · draft · paused.

          One of: "active", "unapproved", "failing", "waiting", "draft", "paused"

        • importedFromstring | null

          One of: "mirth"

        • updatedBystring | null
        • tunnelUpboolean | null
        • failingDestinationstring | null

          When the newest run failed: the destination whose step failed in it.

        • reasonstring

          The line under the status pill, e.g. "PACS not answering", "v3 waiting for review", "no messages yet", "review the import"; empty when none.

    • countsobject

      With stats=1: chip counts over every match.

      7 fields
      • allinteger
      • activeinteger
      • attentioninteger

        Failing, unapproved and waiting workflows.

      • draftinteger
      • pausedinteger
      • mirthinteger

        Workflows imported from Mirth Connect.

      • messages24hinteger

        Runs of every matching workflow in the last 24 h.

  • 400Unknown trigger type or status, or q over 200 characters.

    application/json · ApiError

  • 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/workflows" \
  -H "Authorization: Bearer $TOKEN"

Create workflow

post/api/workflows

Create a new workflow. The graph is validated for cycles before persistence. A new workflow is always a disabled draft: it goes live through Deploy (POST /api/workflows/{id}/deploy), so enabled: true is refused with 409 NOT_DEPLOYED; leave enabled out or send false. A webhook trigger with no webhookId (a template's gives only a path) gets a unique one, returned on the created workflow. A template from GET /api/workflows/templates can be posted as served. A workflow limit set by your license is enforced. Rate limited: 20 req / 60 s.

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

Request body (required)

application/json · object

  • namestringrequired
  • descriptionstring
  • enabledboolean

    Always false on create: true answers 409 NOT_DEPLOYED (deploy the workflow to turn it on).

  • nodesarray of WorkflowNoderequired
  • edgesarray of WorkflowEdgerequired
  • startNodeIdstringrequired
  • triggerobject | object | object | object | object | object | object | object | object | object | object | object | objectrequired

    One of eight supported trigger types. The type discriminant selects the applicable additional fields.

    13 fields
    • type: "manual"object
      1 field
      • typestringrequired

        One of: "manual"

    • type: "topic"object

      Runs once for every event a Publish step writes to the topic (same workspace). Durable fan-out through the work table, at least once, deduplicated by event id.

      2 fields
      • typestringrequired

        One of: "topic"

      • topicstringrequired
    • type: "webhook"object
      13 fields
      • typestringrequired

        One of: "webhook"

      • webhookIdstringrequired
      • pathstring
      • splitBatchesboolean

        Split an HL7 v2 batch (FHS/BHS ... BTS/FTS, or several MSH segments in one delivery) into one run per message, in batch order, each deduplicated on its own MSH-10.

      • charsetstring

        How the received bytes are decoded before parsing. Omitted: UTF-8 (or the Content-Type charset parameter). msh-18: the message's MSH-18 (8859/1, UNICODE UTF-8, ASCII), UTF-8 when it is empty or unknown.

        One of: "utf-8", "iso-8859-1", "windows-1252", "ascii", "msh-18"

      • secretstring
      • timestampToleranceSecondsinteger

        Replay window: the most seconds a signed timestamp (webhook-timestamp or x-webhook-timestamp) may be from the engine's clock. Outside it the answer is 401 TIMESTAMP_OUT_OF_TOLERANCE.

      • requireTimestampboolean

        Refuse a valid signature that carries no signed timestamp (401 TIMESTAMP_REQUIRED). Off: senders that sign the body only keep working.

      • expectedHeadersmap of string
      • bodySchemaobject

        JSON Schema the body must match: type, properties, required, additionalProperties (boolean), items, enum, const, minLength, maxLength, pattern, format (date, date-time, email, uuid), minimum, maximum, minItems, maxItems; $schema, title and description are allowed and not checked; $defs at the root and $ref to #/$defs/<name>. Other keywords are refused on save. A pasted OpenAPI requestBody (with its components) or document ({ document, operationId }) is stored converted to this subset. A body that no trigger on the webhook id accepts is 400 BODY_SCHEMA_INVALID with problems (JSON Pointers, never values), and nothing runs.

      • senderFromobject

        Where a JSON delivery names its sender, for the workflow's sender table ({{sender.KEY}}, per-sender connections): exactly one of path (a dotted path into the body, e.g. organization.id) or header (a header name). The value is matched like an HL7 message's MSH-4.

        2 fields
        • pathstring
        • headerstring
      • orderingstring

        fifo: deliveries run one at a time in arrival order, across every engine replica (an ordering lane per trigger). none: they run in parallel.

        One of: "none", "fifo"

      • onErrorstring

        With ordering fifo. continue: a failed message is reported and the next one runs. hold: a failed message stops its lane; only its own retries and replays run until one succeeds, or the message is discarded from the ACK queue.

        One of: "continue", "hold"

    • type: "schedule"object
      3 fields
      • typestringrequired

        One of: "schedule"

      • cronstringrequired

        Cron expression; an alias of the cron trigger, run once per slot across replicas.

      • timezonestring
    • type: "cron"object
      3 fields
      • typestringrequired

        One of: "cron"

      • cronExpressionstringrequired
      • timezonestring
    • type: "polling"object
      12 fields
      • typestringrequired

        One of: "polling"

      • intervalintegerrequired

        Poll interval in milliseconds (at least 10000).

      • adapterProfileIdstringrequired

        Adapter profile to read; must be in the workflow's workspace.

      • actionstring

        Adapter action to call. Default: search when the adapter has it (FHIR adapters, whose read is read-by-id), otherwise read.

      • paramsobject

        Adapter params. A string value containing {{cursor}} gets the stored cursor; before the first cursor such a value is left out.

      • itemsPathstring

        Dot path to the item array in the adapter result. Not needed for an array or a FHIR Bundle.

      • idFieldstring

        Dot path to each item's id. With cursorField, the dedup key is the id plus its cursor value, so a later change to the same record runs again.

      • cursorFieldstring

        Dot path to an ordered change marker (ISO timestamp or number). Without it, the last 5,000 ids seen are the replay guard.

      • cursorFormatstring

        How cursorField values are written when they do not sort as text (MM/DD/YYYY). Each value is read in this format and stored as ISO-8601; {{cursor}} is sent back in it. A value that does not parse does not run. Changing it starts the cursor again.

        One of: "MM/DD/YYYY", "MM/DD/YYYY HH:mm", "MM/DD/YYYY HH:mm:ss", "MM/DD/YYYY hh:mm A", "MM/DD/YYYY hh:mm:ss A", "DD/MM/YYYY", "DD/MM/YYYY HH:mm:ss", "YYYYMMDDHHmmss", "epoch-seconds", "epoch-millis"

      • maxItemsPerPollinteger

        Items one poll runs. Items sharing the last item's cursor value also run, so a group is never split.

      • filterobject

        Inbound filter ({ logic, rules, groups?, customScript? }), as on the other triggers. A polled item it rejects runs no workflow and creates no work row, but the cursor moves past it, so it is not read again.

      • startFromstring

        now: the first poll records what already exists and runs nothing. beginning: the first poll runs every item.

        One of: "now", "beginning"

    • type: "mllp"object
      13 fields
      • typestringrequired

        One of: "mllp"

      • messageTypesarray of stringrequired
      • sendingFacilitystring
      • sendingAppstring
      • splitBatchesboolean

        Split an HL7 v2 batch (FHS/BHS ... BTS/FTS, or several MSH segments in one delivery) into one run per message, in batch order, each deduplicated on its own MSH-10.

      • charsetstring

        How the received bytes are decoded before parsing. Omitted: UTF-8. msh-18: the message's MSH-18 (8859/1, UNICODE UTF-8, ASCII), UTF-8 when it is empty or unknown.

        One of: "utf-8", "iso-8859-1", "windows-1252", "ascii", "msh-18"

      • listenerstring

        The MLLP listener (port) this trigger takes messages from, declared in Helm mllp.listeners. Omitted: default (mllp.port). A save naming an undeclared listener is a 400.

      • ackModestring

        accept: AA once the message is durably recorded. respond (#751): waits like destination, then answers with the ACK the workflow's Respond step built (a custom MSA and ERR segments, or a whole ACK); with no usable Respond output, the destination-mode outcome; when the wait runs out, ackTimeoutCode. destination: the ACK waits for the workflow's destinations: AA when every one completed, AR when one rejected it for good, AE on any other failure or when they have not finished within ackTimeoutMs. A resend of a message whose delivery failed replays it once and waits again. Not used for messages from an msh15 listener that set MSH-15.

        One of: "accept", "destination", "respond"

      • ackTimeoutMsinteger

        destination and respond modes: how long the ACK waits, capped at the listener's MLLP_TIMEOUT minus 5 s. One sender connection handles one message at a time, so a slow destination slows that sender (intended backpressure).

      • ackTimeoutCodestring

        respond mode: the ACK sent when the run has not settled within ackTimeoutMs. AE: the sender resends (dedup absorbs it). AR: the sender gives up on the message; the recorded run still runs.

        One of: "AE", "AR"

      • ackOnFailurestring

        respond mode, when a step after the Respond step fails: respond keeps the Respond step's ACK (Mirth's respond from destination); AE answers AE "Workflow failed; retry".

        One of: "respond", "AE"

      • filteredAckstring

        The ACK for a message this trigger's filter drops when no other workflow takes it. AR: "No matching triggers". AA: accepted, as Mirth answers for filtered messages. Either way the message is kept in Messages as Filtered, with the rule that dropped it.

        One of: "AR", "AA"

      • onErrorstring

        Messages always run in arrival order per sending facility (lane <trigger>|<MSH-4>). continue: a failed message is reported and the next one runs. hold: a failed message stops its lane; only its own retries and replays run until one succeeds, or the message is discarded from the ACK queue.

        One of: "continue", "hold"

    • type: "fhir-subscription"object
      6 fields
      • typestringrequired

        One of: "fhir-subscription"

      • resourceTypestringrequired
      • criteriastring
      • interactionstring

        One of: "create", "update", "delete", "create-or-update"

      • orderingstring

        fifo: deliveries run one at a time in arrival order, across every engine replica (an ordering lane per trigger; one lane per resourceType/id). none: they run in parallel.

        One of: "none", "fifo"

      • onErrorstring

        With ordering fifo. continue: a failed message is reported and the next one runs. hold: a failed message stops its lane; only its own retries and replays run until one succeeds, or the message is discarded from the ACK queue.

        One of: "continue", "hold"

    • type: "x12"object
      19 fields
      • typestringrequired

        One of: "x12"

      • transactionSetsarray of stringrequired
      • sourceTypestringrequired

        Which deliveries this trigger takes. The server decides a delivery's source: webhook for POST /api/triggers/x12 with a token, upload for a dashboard upload, sftp for the SFTP pickup. A sender cannot claim one.

        One of: "sftp", "webhook", "upload"

      • sftpProfileIdstring

        sourceType sftp: the SFTP adapter profile whose folder the engine polls for X12 files.

      • pollIntervalinteger

        sourceType sftp: milliseconds between pickups.

      • remotePathstring

        sourceType sftp: the folder to pick files up from.

      • filenamePatternstring

        sourceType sftp: a glob (*, ?, [abc]) on the file name.

      • afterProcessingstring

        sourceType sftp: what happens to a file once its transaction sets are recorded. A file is never run twice, leave included: the engine's record of a file does not expire while the file is in the folder, and deduplicate: false does not turn it off.

        One of: "move", "delete", "leave"

      • processedPathstring

        sourceType sftp: where move puts files (required for move).

      • errorPathstring

        sourceType sftp: where a file that is not X12 goes; without it the file stays and the error is recorded.

      • filenameRegexboolean

        filenamePattern is a regular expression matched against the whole name.

      • minFileAgeMsinteger

        A file modified more recently than this may still be being written and waits for a later pickup.

      • maxFileBytesinteger

        A larger file (by its listed size) is never downloaded: it goes to errorPath (or stays) with a size error.

      • sortBystring

        Pickup order: oldest first, or by name.

        One of: "modified", "name"

      • encodingstring

        How file bytes are decoded (latin1: ISO-8859-1).

        One of: "utf8", "latin1"

      • ackPathstring

        sourceType sftp: where the 999 / TA1 (see acknowledgments) are written, as <file>.999 / <file>.ta1.

      • acknowledgmentsstring

        999: a 999 per functional group comes back with the delivery. 999+ta1: also a TA1 when ISA14=1 or the envelope is broken. Syntax checks only (control numbers and counts, a known ST), not implementation-guide validation.

        One of: "none", "999", "999+ta1"

      • orderingstring

        fifo: deliveries run one at a time in arrival order, across every engine replica (an ordering lane per trigger). none: they run in parallel.

        One of: "none", "fifo"

      • onErrorstring

        With ordering fifo. continue: a failed message is reported and the next one runs. hold: a failed message stops its lane; only its own retries and replays run until one succeeds, or the message is discarded from the ACK queue.

        One of: "continue", "hold"

    • type: "sftp"object

      Picks files up from an SFTP folder (like a Mirth File Reader). A file is downloaded only once it is minFileAgeMs old and its listed size is at most maxFileBytes; it is moved, deleted or left only after its runs are recorded, and never runs twice.

      20 fields
      • typestringrequired

        One of: "sftp"

      • sftpProfileIdstringrequired

        The SFTP adapter profile whose folder the engine polls.

      • minFileBytesinteger

        A smaller file is left in place (Mirth fileSizeMinimum).

      • maxFilesPerPollinteger

        At most this many files per pickup; the rest wait for the next one.

      • recursiveboolean

        Also pick up files in subfolders (at most 10 deep), never in processedPath or errorPath. file.name is relative to remotePath; a moved file lands in processedPath by its own name.

      • ignoreDotboolean

        Skip files and folders whose name starts with a dot.

      • remotePathstringrequired

        The folder to pick files up from.

      • pollIntervalintegerrequired

        Milliseconds between pickups.

      • filenamePatternstring

        A glob (*, ?, [abc]) on the file name.

      • filenameRegexboolean

        filenamePattern is a regular expression matched against the whole name.

      • minFileAgeMsinteger

        A file modified more recently than this may still be being written and waits for a later pickup.

      • maxFileBytesinteger

        A larger file (by its listed size) is never downloaded: it goes to errorPath (or stays) with a size error.

      • sortBystring

        Pickup order: oldest first, by name, or smallest first.

        One of: "modified", "name", "size"

      • encodingstring

        How file bytes are decoded (latin1: ISO-8859-1). binary: the run's content is the bytes as base64, with contentEncoding "base64" (not with batch.mode rows).

        One of: "utf8", "latin1", "windows-1252", "ascii", "utf16le", "binary"

      • afterProcessingstring

        What happens to a file once its runs are recorded. leave: the file stays and never runs again while it is unchanged.

        One of: "move", "delete", "leave"

      • processedPathstring

        Where move puts files (required for move; not remotePath).

      • errorPathstring

        Where a file that is too large, or a CSV that does not parse (rows mode), goes; without it the file stays and the error is recorded.

      • batchobject
        3 fields
        • modestring

          file: one run per file, with { file, content }. rows: one run per CSV row, with { file, row, rowIndex, rowCount }; all rows of a file are recorded together.

          One of: "file", "rows"

        • csvobject

          rows mode: csv-parse options (delimiter, recordDelimiter, quote, escape, header, columns, skipLines, trim, skipEmpty, strictColumns, maxRows at most WORKFLOW_MAX_PENDING).

        • fixedWidthobject

          rows mode, instead of csv: fixed-width-parse options (columns or records, recordDelimiter, recordLength, headerLines, footerLines, unknownRecords, maxRows at most WORKFLOW_MAX_PENDING); one run per record.

      • orderingstring

        fifo: runs execute one at a time in pickup order (files, then rows), across every engine replica.

        One of: "none", "fifo"

      • onErrorstring

        With ordering fifo: what a failed run does to its lane.

        One of: "continue", "hold"

    • type: "file"object

      Picks files up from the folder of a file, ftp, smb, webdav, s3 or sftp adapter profile (a Mirth File Reader over any scheme, P138). Same settings and runs as the sftp trigger; triggerType is "file".

      20 fields
      • typestringrequired

        One of: "file"

      • adapterProfileIdstringrequired

        The adapter profile whose folder the engine polls: its adapter type (file, ftp, smb, webdav, s3 or sftp) is the transport.

      • minFileBytesinteger

        A smaller file is left in place (Mirth fileSizeMinimum).

      • maxFilesPerPollinteger

        At most this many files per pickup; the rest wait for the next one.

      • recursiveboolean

        Also pick up files in subfolders (at most 10 deep), never in processedPath or errorPath. file.name is relative to remotePath; a moved file lands in processedPath by its own name.

      • ignoreDotboolean

        Skip files and folders whose name starts with a dot.

      • remotePathstringrequired

        The folder to pick files up from.

      • pollIntervalintegerrequired

        Milliseconds between pickups.

      • filenamePatternstring

        A glob (*, ?, [abc]) on the file name.

      • filenameRegexboolean

        filenamePattern is a regular expression matched against the whole name.

      • minFileAgeMsinteger

        A file modified more recently than this may still be being written and waits for a later pickup.

      • maxFileBytesinteger

        A larger file (by its listed size) is never downloaded: it goes to errorPath (or stays) with a size error.

      • sortBystring

        Pickup order: oldest first, by name, or smallest first.

        One of: "modified", "name", "size"

      • encodingstring

        How file bytes are decoded (latin1: ISO-8859-1). binary: the run's content is the bytes as base64, with contentEncoding "base64" (not with batch.mode rows).

        One of: "utf8", "latin1", "windows-1252", "ascii", "utf16le", "binary"

      • afterProcessingstring

        What happens to a file once its runs are recorded. leave: the file stays and never runs again while it is unchanged.

        One of: "move", "delete", "leave"

      • processedPathstring

        Where move puts files (required for move; not remotePath).

      • errorPathstring

        Where a file that is too large, or a CSV that does not parse (rows mode), goes; without it the file stays and the error is recorded.

      • batchobject
        3 fields
        • modestring

          file: one run per file, with { file, content }. rows: one run per CSV row, with { file, row, rowIndex, rowCount }; all rows of a file are recorded together.

          One of: "file", "rows"

        • csvobject

          rows mode: csv-parse options (delimiter, recordDelimiter, quote, escape, header, columns, skipLines, trim, skipEmpty, strictColumns, maxRows at most WORKFLOW_MAX_PENDING).

        • fixedWidthobject

          rows mode, instead of csv: fixed-width-parse options (columns or records, recordDelimiter, recordLength, headerLines, footerLines, unknownRecords, maxRows at most WORKFLOW_MAX_PENDING); one run per record.

      • orderingstring

        fifo: runs execute one at a time in pickup order (files, then rows), across every engine replica.

        One of: "none", "fifo"

      • onErrorstring

        With ordering fifo: what a failed run does to its lane.

        One of: "continue", "hold"

    • type: "jms"object

      Consumes a JMS queue or topic over AMQP 1.0 (a Mirth JMS Listener) through a jms adapter profile. One engine replica consumes each trigger. A message is acknowledged to the broker only once its run is recorded, so a crash redelivers it, and the JMS message id dedups the redelivery. A message the filter drops is acknowledged; one that can't be recorded (license, backlog, shutdown) stays on the broker.

      10 fields
      • typestringrequired

        One of: "jms"

      • adapterProfileIdstringrequired

        The jms adapter profile (broker host, login, TLS).

      • destinationstringrequired

        Queue or topic name.

      • destinationTypestring

        One of: "queue", "topic"

      • subscriptionNamestring

        Topics: a durable subscription under this name (the profile's clientId, else medhook-<workflowId>, is its client id), so messages sent while no engine is connected wait for it.

      • selectorstring

        A JMS message selector, applied by the broker.

      • prefetchinteger

        Messages the broker may send ahead of acknowledgement.

      • orderingstring

        One of: "none", "fifo"

      • onErrorstring

        One of: "continue", "hold"

      • deduplicateboolean
    • type: "soap"object

      A SOAP 1.1/1.2 endpoint at /api/triggers/soap/{listenerId} with its WSDL at ?wsdl (a Mirth Web Service Listener).

      15 fields
      • typestringrequired

        One of: "soap"

      • listenerIdstringrequired
      • serviceNamestring

        The generated WSDL's service name.

      • namespacestring

        The generated WSDL's target namespace.

      • soapVersionstring

        One of: "1.1", "1.2", "both"

      • operationsarray of string

        Operation (Body element) names it takes; empty takes any.

      • wsSecuritystring

        One of: "none", "UsernameToken"

      • wsUsernamestring
      • wsPasswordstring

        Write-only: stored encrypted, read back as __set__.

      • secretstring

        HMAC-SHA256 key for x-webhook-signature. Write-only, read back as __set__.

      • wsdlstring

        A WSDL to serve instead of the generated one.

      • responseobject
        3 fields
        • modestring

          One of: "accepted", "destination"

        • nodeIdstring
        • timeoutMsinteger
      • orderingstring

        One of: "none", "fifo"

      • onErrorstring

        One of: "continue", "hold"

      • deduplicateboolean
  • metadataobject
  • fromAgentboolean

    True when a person saves the Agent's workflow draft (the Agent screen's Save draft, or the builder hand-off). The workflow.created audit event then carries proposedBy: "agent", and People counts the save as one of the Agent's changes. Never stored on the workflow.

  • conversationTitlestring

    With fromAgent only: the title of the Agent conversation the draft came from (its first question), for the Audit log's Agent action note. Only the title is sent; the conversation stays in the browser. It is folded onto one line, cut to 80 characters and its digit runs masked, then kept on the workflow.created audit event as conversationTitle, or dropped when it still looks like PHI (a name after a cue, an email, a phone number, a date). Never stored on the workflow.

  • maxWorkflowRetriesinteger
  • workflowRetryDelayMsinteger

Responses

  • 201Workflow created.
    Response fields

    application/json · object

  • 400Request body or query parameters failed validation.

    application/json · ApiError

  • 401Missing or invalid JWT Bearer token.

    application/json · ApiError

  • 403Workflow limit reached.

    application/json · ApiError

  • 409`NOT_DEPLOYED`: the body asked for `enabled: true`. A new workflow starts disabled and goes live through Deploy.

    application/json · ApiError

  • 429Rate limit exceeded.

    application/json · ApiError

  • 500Unexpected server error.

    application/json · ApiError

Example request

curl
curl -X POST "$ENGINE_URL/api/workflows" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "string",
  "description": "string",
  "enabled": false,
  "nodes": [
    {
      "id": "node-1",
      "type": "adapter",
      "label": "Fetch Patients",
      "position": {
        "x": 0,
        "y": 0
      },
      "data": {
        "errorHandling": {
          "strategy": "retry",
          "maxRetries": 3,
          "retryDelay": 1000,
          "backoffMultiplier": 2
        },
        "mapping": [
          {
            "source": "string",
            "sources": [
              "string"
            ],
            "separator": "string",
            "target": "string",
            "transform": "uppercase",
            "ops": [
              {}
            ],
            "default": "string",
            "lookupValues": [
              {
                "from": "string",
                "to": "string",
                "note": "string"
              }
            ],
            "lookup": "string",
            "onMissingCode": "fail"
          }
        ],
        "config": {
          "mapMode": "new",
          "onRowError": "fail",
          "mappingMode": "merge",
          "nextOfKin": "skip",
          "messageHeader": "skip",
          "fields": [
            "string"
          ],
          "onMissingCode": "fail",
          "codeTables": [
            "string"
          ],
          "escape": "none",
          "onMissing": "empty",
          "delimiter": ",",
          "recordDelimiter": "auto",
          "quote": "\"",
          "header": true,
          "columns": [
            null
          ],
          "maxRows": 10000,
          "quoteMode": "minimal",
          "xpaths": {},
          "stripNamespaces": true,
          "stylesheet": "string",
          "source": "message",
          "sourceField": "string",
          "sourceVariable": "string",
          "resultTo": "message",
          "resultField": "string",
          "resultVariable": "string",
          "params": [
            {
              "name": "string",
              "value": "string"
            }
          ]
        }
      }
    }
  ],
  "edges": [
    {
      "id": "edge-1",
      "source": "node-1",
      "target": "node-2",
      "label": "success"
    }
  ],
  "startNodeId": "string",
  "trigger": {
    "type": "manual"
  },
  "metadata": {},
  "fromAgent": true,
  "conversationTitle": "string",
  "maxWorkflowRetries": 0,
  "workflowRetryDelayMs": 1000
}'

List workflow templates

get/api/workflows/templates

Returns built-in workflow templates for common integration patterns. When source=community or source=all is supplied, the engine proxies to the medhook.dev marketplace and may be slower.

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

Parameters

NameInTypeDescription
idquerystring

Return a single template by ID.

categoryquerystring
qquerystring

Free-text search over name, description, and tags.

shapequerystring

Only templates that follow this pattern. Unknown values are a 400.

sourcequerystring

Responses

  • 200Template list.
    Response fields

    application/json · object

  • 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/workflows/templates" \
  -H "Authorization: Bearer $TOKEN"

Get workflow

get/api/workflows/{id}

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

Parameters

NameInTypeDescription
idrequiredpathstring

Workflow ID.

Responses

  • 200Workflow detail.
    Response fields

    application/json · object

    • workflowWorkflowrequired
    • deployedVersioninteger | nullrequired

      The version production runs, or null when none was ever deployed. A newer saved version is a draft.

  • 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 "$ENGINE_URL/api/workflows/wf_abc123" \
  -H "Authorization: Bearer $TOKEN"

Update workflow

put/api/workflows/{id}

400 when the trigger can never fire: a cron or schedule expression that can't be scheduled or an unknown time zone (details.issues code INVALID_CRON), or a FHIR subscription resourceType that isn't a resource type name (INVALID_FHIR_RESOURCE_TYPE). These are rejected enabled or not; an empty expression or resource type only blocks an enabled save. Also 400 for an enabled workflow with a destination whose profile is missing (DESTINATION_PROFILE_MISSING) or read-only (DESTINATION_READ_ONLY), or with a per-sender connection of another adapter than the step's default (SENDER_PROFILE_TYPE_MISMATCH), or with a Component step that has a connection per sender while its component sends through more than one connection (COMPONENT_SENDS_DIFFER).

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

Parameters

NameInTypeDescription
idrequiredpathstring

Workflow ID.

Request body (required)

application/json · object

  • namestring
  • descriptionstring
  • enabledboolean
  • nodesarray of WorkflowNode
  • edgesarray of WorkflowEdge
  • startNodeIdstring
  • triggerobject | object | object | object | object | object | object | object | object | object | object | object | object

    One of eight supported trigger types. The type discriminant selects the applicable additional fields.

    13 fields
    • type: "manual"object
      1 field
      • typestringrequired

        One of: "manual"

    • type: "topic"object

      Runs once for every event a Publish step writes to the topic (same workspace). Durable fan-out through the work table, at least once, deduplicated by event id.

      2 fields
      • typestringrequired

        One of: "topic"

      • topicstringrequired
    • type: "webhook"object
      13 fields
      • typestringrequired

        One of: "webhook"

      • webhookIdstringrequired
      • pathstring
      • splitBatchesboolean

        Split an HL7 v2 batch (FHS/BHS ... BTS/FTS, or several MSH segments in one delivery) into one run per message, in batch order, each deduplicated on its own MSH-10.

      • charsetstring

        How the received bytes are decoded before parsing. Omitted: UTF-8 (or the Content-Type charset parameter). msh-18: the message's MSH-18 (8859/1, UNICODE UTF-8, ASCII), UTF-8 when it is empty or unknown.

        One of: "utf-8", "iso-8859-1", "windows-1252", "ascii", "msh-18"

      • secretstring
      • timestampToleranceSecondsinteger

        Replay window: the most seconds a signed timestamp (webhook-timestamp or x-webhook-timestamp) may be from the engine's clock. Outside it the answer is 401 TIMESTAMP_OUT_OF_TOLERANCE.

      • requireTimestampboolean

        Refuse a valid signature that carries no signed timestamp (401 TIMESTAMP_REQUIRED). Off: senders that sign the body only keep working.

      • expectedHeadersmap of string
      • bodySchemaobject

        JSON Schema the body must match: type, properties, required, additionalProperties (boolean), items, enum, const, minLength, maxLength, pattern, format (date, date-time, email, uuid), minimum, maximum, minItems, maxItems; $schema, title and description are allowed and not checked; $defs at the root and $ref to #/$defs/<name>. Other keywords are refused on save. A pasted OpenAPI requestBody (with its components) or document ({ document, operationId }) is stored converted to this subset. A body that no trigger on the webhook id accepts is 400 BODY_SCHEMA_INVALID with problems (JSON Pointers, never values), and nothing runs.

      • senderFromobject

        Where a JSON delivery names its sender, for the workflow's sender table ({{sender.KEY}}, per-sender connections): exactly one of path (a dotted path into the body, e.g. organization.id) or header (a header name). The value is matched like an HL7 message's MSH-4.

        2 fields
        • pathstring
        • headerstring
      • orderingstring

        fifo: deliveries run one at a time in arrival order, across every engine replica (an ordering lane per trigger). none: they run in parallel.

        One of: "none", "fifo"

      • onErrorstring

        With ordering fifo. continue: a failed message is reported and the next one runs. hold: a failed message stops its lane; only its own retries and replays run until one succeeds, or the message is discarded from the ACK queue.

        One of: "continue", "hold"

    • type: "schedule"object
      3 fields
      • typestringrequired

        One of: "schedule"

      • cronstringrequired

        Cron expression; an alias of the cron trigger, run once per slot across replicas.

      • timezonestring
    • type: "cron"object
      3 fields
      • typestringrequired

        One of: "cron"

      • cronExpressionstringrequired
      • timezonestring
    • type: "polling"object
      12 fields
      • typestringrequired

        One of: "polling"

      • intervalintegerrequired

        Poll interval in milliseconds (at least 10000).

      • adapterProfileIdstringrequired

        Adapter profile to read; must be in the workflow's workspace.

      • actionstring

        Adapter action to call. Default: search when the adapter has it (FHIR adapters, whose read is read-by-id), otherwise read.

      • paramsobject

        Adapter params. A string value containing {{cursor}} gets the stored cursor; before the first cursor such a value is left out.

      • itemsPathstring

        Dot path to the item array in the adapter result. Not needed for an array or a FHIR Bundle.

      • idFieldstring

        Dot path to each item's id. With cursorField, the dedup key is the id plus its cursor value, so a later change to the same record runs again.

      • cursorFieldstring

        Dot path to an ordered change marker (ISO timestamp or number). Without it, the last 5,000 ids seen are the replay guard.

      • cursorFormatstring

        How cursorField values are written when they do not sort as text (MM/DD/YYYY). Each value is read in this format and stored as ISO-8601; {{cursor}} is sent back in it. A value that does not parse does not run. Changing it starts the cursor again.

        One of: "MM/DD/YYYY", "MM/DD/YYYY HH:mm", "MM/DD/YYYY HH:mm:ss", "MM/DD/YYYY hh:mm A", "MM/DD/YYYY hh:mm:ss A", "DD/MM/YYYY", "DD/MM/YYYY HH:mm:ss", "YYYYMMDDHHmmss", "epoch-seconds", "epoch-millis"

      • maxItemsPerPollinteger

        Items one poll runs. Items sharing the last item's cursor value also run, so a group is never split.

      • filterobject

        Inbound filter ({ logic, rules, groups?, customScript? }), as on the other triggers. A polled item it rejects runs no workflow and creates no work row, but the cursor moves past it, so it is not read again.

      • startFromstring

        now: the first poll records what already exists and runs nothing. beginning: the first poll runs every item.

        One of: "now", "beginning"

    • type: "mllp"object
      13 fields
      • typestringrequired

        One of: "mllp"

      • messageTypesarray of stringrequired
      • sendingFacilitystring
      • sendingAppstring
      • splitBatchesboolean

        Split an HL7 v2 batch (FHS/BHS ... BTS/FTS, or several MSH segments in one delivery) into one run per message, in batch order, each deduplicated on its own MSH-10.

      • charsetstring

        How the received bytes are decoded before parsing. Omitted: UTF-8. msh-18: the message's MSH-18 (8859/1, UNICODE UTF-8, ASCII), UTF-8 when it is empty or unknown.

        One of: "utf-8", "iso-8859-1", "windows-1252", "ascii", "msh-18"

      • listenerstring

        The MLLP listener (port) this trigger takes messages from, declared in Helm mllp.listeners. Omitted: default (mllp.port). A save naming an undeclared listener is a 400.

      • ackModestring

        accept: AA once the message is durably recorded. respond (#751): waits like destination, then answers with the ACK the workflow's Respond step built (a custom MSA and ERR segments, or a whole ACK); with no usable Respond output, the destination-mode outcome; when the wait runs out, ackTimeoutCode. destination: the ACK waits for the workflow's destinations: AA when every one completed, AR when one rejected it for good, AE on any other failure or when they have not finished within ackTimeoutMs. A resend of a message whose delivery failed replays it once and waits again. Not used for messages from an msh15 listener that set MSH-15.

        One of: "accept", "destination", "respond"

      • ackTimeoutMsinteger

        destination and respond modes: how long the ACK waits, capped at the listener's MLLP_TIMEOUT minus 5 s. One sender connection handles one message at a time, so a slow destination slows that sender (intended backpressure).

      • ackTimeoutCodestring

        respond mode: the ACK sent when the run has not settled within ackTimeoutMs. AE: the sender resends (dedup absorbs it). AR: the sender gives up on the message; the recorded run still runs.

        One of: "AE", "AR"

      • ackOnFailurestring

        respond mode, when a step after the Respond step fails: respond keeps the Respond step's ACK (Mirth's respond from destination); AE answers AE "Workflow failed; retry".

        One of: "respond", "AE"

      • filteredAckstring

        The ACK for a message this trigger's filter drops when no other workflow takes it. AR: "No matching triggers". AA: accepted, as Mirth answers for filtered messages. Either way the message is kept in Messages as Filtered, with the rule that dropped it.

        One of: "AR", "AA"

      • onErrorstring

        Messages always run in arrival order per sending facility (lane <trigger>|<MSH-4>). continue: a failed message is reported and the next one runs. hold: a failed message stops its lane; only its own retries and replays run until one succeeds, or the message is discarded from the ACK queue.

        One of: "continue", "hold"

    • type: "fhir-subscription"object
      6 fields
      • typestringrequired

        One of: "fhir-subscription"

      • resourceTypestringrequired
      • criteriastring
      • interactionstring

        One of: "create", "update", "delete", "create-or-update"

      • orderingstring

        fifo: deliveries run one at a time in arrival order, across every engine replica (an ordering lane per trigger; one lane per resourceType/id). none: they run in parallel.

        One of: "none", "fifo"

      • onErrorstring

        With ordering fifo. continue: a failed message is reported and the next one runs. hold: a failed message stops its lane; only its own retries and replays run until one succeeds, or the message is discarded from the ACK queue.

        One of: "continue", "hold"

    • type: "x12"object
      19 fields
      • typestringrequired

        One of: "x12"

      • transactionSetsarray of stringrequired
      • sourceTypestringrequired

        Which deliveries this trigger takes. The server decides a delivery's source: webhook for POST /api/triggers/x12 with a token, upload for a dashboard upload, sftp for the SFTP pickup. A sender cannot claim one.

        One of: "sftp", "webhook", "upload"

      • sftpProfileIdstring

        sourceType sftp: the SFTP adapter profile whose folder the engine polls for X12 files.

      • pollIntervalinteger

        sourceType sftp: milliseconds between pickups.

      • remotePathstring

        sourceType sftp: the folder to pick files up from.

      • filenamePatternstring

        sourceType sftp: a glob (*, ?, [abc]) on the file name.

      • afterProcessingstring

        sourceType sftp: what happens to a file once its transaction sets are recorded. A file is never run twice, leave included: the engine's record of a file does not expire while the file is in the folder, and deduplicate: false does not turn it off.

        One of: "move", "delete", "leave"

      • processedPathstring

        sourceType sftp: where move puts files (required for move).

      • errorPathstring

        sourceType sftp: where a file that is not X12 goes; without it the file stays and the error is recorded.

      • filenameRegexboolean

        filenamePattern is a regular expression matched against the whole name.

      • minFileAgeMsinteger

        A file modified more recently than this may still be being written and waits for a later pickup.

      • maxFileBytesinteger

        A larger file (by its listed size) is never downloaded: it goes to errorPath (or stays) with a size error.

      • sortBystring

        Pickup order: oldest first, or by name.

        One of: "modified", "name"

      • encodingstring

        How file bytes are decoded (latin1: ISO-8859-1).

        One of: "utf8", "latin1"

      • ackPathstring

        sourceType sftp: where the 999 / TA1 (see acknowledgments) are written, as <file>.999 / <file>.ta1.

      • acknowledgmentsstring

        999: a 999 per functional group comes back with the delivery. 999+ta1: also a TA1 when ISA14=1 or the envelope is broken. Syntax checks only (control numbers and counts, a known ST), not implementation-guide validation.

        One of: "none", "999", "999+ta1"

      • orderingstring

        fifo: deliveries run one at a time in arrival order, across every engine replica (an ordering lane per trigger). none: they run in parallel.

        One of: "none", "fifo"

      • onErrorstring

        With ordering fifo. continue: a failed message is reported and the next one runs. hold: a failed message stops its lane; only its own retries and replays run until one succeeds, or the message is discarded from the ACK queue.

        One of: "continue", "hold"

    • type: "sftp"object

      Picks files up from an SFTP folder (like a Mirth File Reader). A file is downloaded only once it is minFileAgeMs old and its listed size is at most maxFileBytes; it is moved, deleted or left only after its runs are recorded, and never runs twice.

      20 fields
      • typestringrequired

        One of: "sftp"

      • sftpProfileIdstringrequired

        The SFTP adapter profile whose folder the engine polls.

      • minFileBytesinteger

        A smaller file is left in place (Mirth fileSizeMinimum).

      • maxFilesPerPollinteger

        At most this many files per pickup; the rest wait for the next one.

      • recursiveboolean

        Also pick up files in subfolders (at most 10 deep), never in processedPath or errorPath. file.name is relative to remotePath; a moved file lands in processedPath by its own name.

      • ignoreDotboolean

        Skip files and folders whose name starts with a dot.

      • remotePathstringrequired

        The folder to pick files up from.

      • pollIntervalintegerrequired

        Milliseconds between pickups.

      • filenamePatternstring

        A glob (*, ?, [abc]) on the file name.

      • filenameRegexboolean

        filenamePattern is a regular expression matched against the whole name.

      • minFileAgeMsinteger

        A file modified more recently than this may still be being written and waits for a later pickup.

      • maxFileBytesinteger

        A larger file (by its listed size) is never downloaded: it goes to errorPath (or stays) with a size error.

      • sortBystring

        Pickup order: oldest first, by name, or smallest first.

        One of: "modified", "name", "size"

      • encodingstring

        How file bytes are decoded (latin1: ISO-8859-1). binary: the run's content is the bytes as base64, with contentEncoding "base64" (not with batch.mode rows).

        One of: "utf8", "latin1", "windows-1252", "ascii", "utf16le", "binary"

      • afterProcessingstring

        What happens to a file once its runs are recorded. leave: the file stays and never runs again while it is unchanged.

        One of: "move", "delete", "leave"

      • processedPathstring

        Where move puts files (required for move; not remotePath).

      • errorPathstring

        Where a file that is too large, or a CSV that does not parse (rows mode), goes; without it the file stays and the error is recorded.

      • batchobject
        3 fields
        • modestring

          file: one run per file, with { file, content }. rows: one run per CSV row, with { file, row, rowIndex, rowCount }; all rows of a file are recorded together.

          One of: "file", "rows"

        • csvobject

          rows mode: csv-parse options (delimiter, recordDelimiter, quote, escape, header, columns, skipLines, trim, skipEmpty, strictColumns, maxRows at most WORKFLOW_MAX_PENDING).

        • fixedWidthobject

          rows mode, instead of csv: fixed-width-parse options (columns or records, recordDelimiter, recordLength, headerLines, footerLines, unknownRecords, maxRows at most WORKFLOW_MAX_PENDING); one run per record.

      • orderingstring

        fifo: runs execute one at a time in pickup order (files, then rows), across every engine replica.

        One of: "none", "fifo"

      • onErrorstring

        With ordering fifo: what a failed run does to its lane.

        One of: "continue", "hold"

    • type: "file"object

      Picks files up from the folder of a file, ftp, smb, webdav, s3 or sftp adapter profile (a Mirth File Reader over any scheme, P138). Same settings and runs as the sftp trigger; triggerType is "file".

      20 fields
      • typestringrequired

        One of: "file"

      • adapterProfileIdstringrequired

        The adapter profile whose folder the engine polls: its adapter type (file, ftp, smb, webdav, s3 or sftp) is the transport.

      • minFileBytesinteger

        A smaller file is left in place (Mirth fileSizeMinimum).

      • maxFilesPerPollinteger

        At most this many files per pickup; the rest wait for the next one.

      • recursiveboolean

        Also pick up files in subfolders (at most 10 deep), never in processedPath or errorPath. file.name is relative to remotePath; a moved file lands in processedPath by its own name.

      • ignoreDotboolean

        Skip files and folders whose name starts with a dot.

      • remotePathstringrequired

        The folder to pick files up from.

      • pollIntervalintegerrequired

        Milliseconds between pickups.

      • filenamePatternstring

        A glob (*, ?, [abc]) on the file name.

      • filenameRegexboolean

        filenamePattern is a regular expression matched against the whole name.

      • minFileAgeMsinteger

        A file modified more recently than this may still be being written and waits for a later pickup.

      • maxFileBytesinteger

        A larger file (by its listed size) is never downloaded: it goes to errorPath (or stays) with a size error.

      • sortBystring

        Pickup order: oldest first, by name, or smallest first.

        One of: "modified", "name", "size"

      • encodingstring

        How file bytes are decoded (latin1: ISO-8859-1). binary: the run's content is the bytes as base64, with contentEncoding "base64" (not with batch.mode rows).

        One of: "utf8", "latin1", "windows-1252", "ascii", "utf16le", "binary"

      • afterProcessingstring

        What happens to a file once its runs are recorded. leave: the file stays and never runs again while it is unchanged.

        One of: "move", "delete", "leave"

      • processedPathstring

        Where move puts files (required for move; not remotePath).

      • errorPathstring

        Where a file that is too large, or a CSV that does not parse (rows mode), goes; without it the file stays and the error is recorded.

      • batchobject
        3 fields
        • modestring

          file: one run per file, with { file, content }. rows: one run per CSV row, with { file, row, rowIndex, rowCount }; all rows of a file are recorded together.

          One of: "file", "rows"

        • csvobject

          rows mode: csv-parse options (delimiter, recordDelimiter, quote, escape, header, columns, skipLines, trim, skipEmpty, strictColumns, maxRows at most WORKFLOW_MAX_PENDING).

        • fixedWidthobject

          rows mode, instead of csv: fixed-width-parse options (columns or records, recordDelimiter, recordLength, headerLines, footerLines, unknownRecords, maxRows at most WORKFLOW_MAX_PENDING); one run per record.

      • orderingstring

        fifo: runs execute one at a time in pickup order (files, then rows), across every engine replica.

        One of: "none", "fifo"

      • onErrorstring

        With ordering fifo: what a failed run does to its lane.

        One of: "continue", "hold"

    • type: "jms"object

      Consumes a JMS queue or topic over AMQP 1.0 (a Mirth JMS Listener) through a jms adapter profile. One engine replica consumes each trigger. A message is acknowledged to the broker only once its run is recorded, so a crash redelivers it, and the JMS message id dedups the redelivery. A message the filter drops is acknowledged; one that can't be recorded (license, backlog, shutdown) stays on the broker.

      10 fields
      • typestringrequired

        One of: "jms"

      • adapterProfileIdstringrequired

        The jms adapter profile (broker host, login, TLS).

      • destinationstringrequired

        Queue or topic name.

      • destinationTypestring

        One of: "queue", "topic"

      • subscriptionNamestring

        Topics: a durable subscription under this name (the profile's clientId, else medhook-<workflowId>, is its client id), so messages sent while no engine is connected wait for it.

      • selectorstring

        A JMS message selector, applied by the broker.

      • prefetchinteger

        Messages the broker may send ahead of acknowledgement.

      • orderingstring

        One of: "none", "fifo"

      • onErrorstring

        One of: "continue", "hold"

      • deduplicateboolean
    • type: "soap"object

      A SOAP 1.1/1.2 endpoint at /api/triggers/soap/{listenerId} with its WSDL at ?wsdl (a Mirth Web Service Listener).

      15 fields
      • typestringrequired

        One of: "soap"

      • listenerIdstringrequired
      • serviceNamestring

        The generated WSDL's service name.

      • namespacestring

        The generated WSDL's target namespace.

      • soapVersionstring

        One of: "1.1", "1.2", "both"

      • operationsarray of string

        Operation (Body element) names it takes; empty takes any.

      • wsSecuritystring

        One of: "none", "UsernameToken"

      • wsUsernamestring
      • wsPasswordstring

        Write-only: stored encrypted, read back as __set__.

      • secretstring

        HMAC-SHA256 key for x-webhook-signature. Write-only, read back as __set__.

      • wsdlstring

        A WSDL to serve instead of the generated one.

      • responseobject
        3 fields
        • modestring

          One of: "accepted", "destination"

        • nodeIdstring
        • timeoutMsinteger
      • orderingstring

        One of: "none", "fifo"

      • onErrorstring

        One of: "continue", "hold"

      • deduplicateboolean
  • metadataobject
  • changeNotestring | null

    What this save changed, shown in Versions instead of the generated summary. Kept with the version the save makes; a save that changes nothing keeps the note it had.

  • maxWorkflowRetriesinteger
  • workflowRetryDelayMsinteger

Responses

  • 200Workflow updated.
    Response fields

    application/json · object

  • 400Request body or query parameters failed validation.

    application/json · ApiError

  • 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 PUT "$ENGINE_URL/api/workflows/wf_abc123" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "string",
  "description": "string",
  "enabled": true,
  "nodes": [
    {
      "id": "node-1",
      "type": "adapter",
      "label": "Fetch Patients",
      "position": {
        "x": 0,
        "y": 0
      },
      "data": {
        "errorHandling": {
          "strategy": "retry",
          "maxRetries": 3,
          "retryDelay": 1000,
          "backoffMultiplier": 2
        },
        "mapping": [
          {
            "source": "string",
            "sources": [
              "string"
            ],
            "separator": "string",
            "target": "string",
            "transform": "uppercase",
            "ops": [
              {}
            ],
            "default": "string",
            "lookupValues": [
              {
                "from": "string",
                "to": "string",
                "note": "string"
              }
            ],
            "lookup": "string",
            "onMissingCode": "fail"
          }
        ],
        "config": {
          "mapMode": "new",
          "onRowError": "fail",
          "mappingMode": "merge",
          "nextOfKin": "skip",
          "messageHeader": "skip",
          "fields": [
            "string"
          ],
          "onMissingCode": "fail",
          "codeTables": [
            "string"
          ],
          "escape": "none",
          "onMissing": "empty",
          "delimiter": ",",
          "recordDelimiter": "auto",
          "quote": "\"",
          "header": true,
          "columns": [
            null
          ],
          "maxRows": 10000,
          "quoteMode": "minimal",
          "xpaths": {},
          "stripNamespaces": true,
          "stylesheet": "string",
          "source": "message",
          "sourceField": "string",
          "sourceVariable": "string",
          "resultTo": "message",
          "resultField": "string",
          "resultVariable": "string",
          "params": [
            {
              "name": "string",
              "value": "string"
            }
          ]
        }
      }
    }
  ],
  "edges": [
    {
      "id": "edge-1",
      "source": "node-1",
      "target": "node-2",
      "label": "success"
    }
  ],
  "startNodeId": "string",
  "trigger": {
    "type": "manual"
  },
  "metadata": {},
  "changeNote": "string",
  "maxWorkflowRetries": 0,
  "workflowRetryDelayMs": 1000
}'

Turn a workflow on or off, or change its settings

patch/api/workflows/{id}

{ enabled } turns the workflow on or off (audited as workflow.enabled or workflow.disabled). A body with owner, tags or maxInFlight (the Settings tab's General and Delivery fields, without enabled) saves those instead: owner up to 120 characters, null clears it; tags up to 10, each 1 to 32 characters, lowercased with repeats dropped; maxInFlight a whole number from 1 to 64, null for no limit: the work runner starts the workflow's queued runs (webhook, MLLP, X12, FHIR, file and other intake, retries, replays) and its polls only while fewer than that many of its runs are running, across replicas, holding the rest as pending without holding up other workflows. A manual run (POST /api/workflows/:id/execute) is not held back but counts while it runs. A change is audited as workflow.updated with changed, the keys whose value differs, and their new values; an unchanged save writes and audits nothing. Either way it does not touch the definition and records no version. Ordering and Duplicate messages are the trigger's config: they change with the workflow save (PUT).

Minimum role: operator.

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

Parameters

NameInTypeDescription
idrequiredpathstring

Workflow id.

Request body (required)

application/json · object

  • enabledboolean
  • ownerstring | null

    Who owns the workflow (an email or a name).

  • tagsarray of string
  • maxInFlightinteger | null

    Most runs at once; null = no limit.

Responses

  • 200Updated.
    Response fields

    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

  • 404Not found in the caller's workspace.

    application/json · ApiError

  • 500Unexpected server error.

    application/json · ApiError

Example request

curl
curl -X PATCH "$ENGINE_URL/api/workflows/<id>" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "enabled": true,
  "owner": "string",
  "tags": [
    "string"
  ],
  "maxInFlight": 1
}'

Delete workflow

delete/api/workflows/{id}

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

Parameters

NameInTypeDescription
idrequiredpathstring

Workflow ID.

Responses

  • 200Workflow deleted.
    Response fields

    application/json · object

    • successbooleanrequired
    • deletedAtstring (date-time)
  • 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 DELETE "$ENGINE_URL/api/workflows/wf_abc123" \
  -H "Authorization: Bearer $TOKEN"

Execute workflow

post/api/workflows/{id}/execute

Manually trigger a workflow execution. The call is synchronous: it runs the deployed version and answers when the run ends, with its status and each step's result in execution.nodeResults (a long run holds the request open, up to the workflow timeout WORKFLOW_TIMEOUT_MS, 30 minutes by default). A failed run is still a 200: read execution.status. Errors are { error, code }: 404 NOT_FOUND when the workflow is not in the caller's workspace, 403 WORKFLOW_DISABLED when it is not deployed or is turned off, 500 INTERNAL_ERROR (the cause is in the engine log, never in the answer). It takes a slot of the replica's execution queue (MAX_CONCURRENT_WORKFLOWS, shared by every run on the replica): when none frees up within 60 s the answer is 429. While the replica shuts down it starts nothing and answers 503 SHUTTING_DOWN; retry and another replica runs it. If the execution history row cannot be written, the run does not start and the answer is 503 HISTORY_UNAVAILABLE: nothing was sent.

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

Parameters

NameInTypeDescription
idrequiredpathstring

Workflow ID.

Request body

application/json · object

  • inputobject

    Optional input payload available to nodes as $.input.

Responses

  • 200The run ended: `execution.status` is `completed`, `partial` or `failed`, and `execution.nodeResults` holds each step's result by step id.
    Response fields

    application/json · object

  • 401Missing or invalid JWT Bearer token.

    application/json · ApiError

  • 403`code: WORKFLOW_DISABLED` when the workflow is not deployed or is turned off. Also answered without a valid license, and for a PHI workflow on a license without the PHI claim.

    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

  • 503The replica is shutting down (`code: SHUTTING_DOWN`; retry after `Retry-After` seconds), or the execution history row could not be written (`code: HISTORY_UNAVAILABLE`; check Postgres, then retry). Either way nothing was started.
    Response fields

    application/json · object

    • errorstring
    • codestring

      One of: "SHUTTING_DOWN", "HISTORY_UNAVAILABLE"

    • messagestring

Example request

curl
curl -X POST "$ENGINE_URL/api/workflows/wf_abc123/execute" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "input": {}
}'

Get workflow publish history

get/api/workflows/{id}/publish

Returns the last 5 local publish records for the workflow.

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

Parameters

NameInTypeDescription
idrequiredpathstring

Workflow ID.

Responses

  • 200Publish history.
    Response fields

    application/json · object

    • publishesarray of objectrequired
      7 fields
      • idstring
      • versionstring
      • changelogstring
      • publishedAtstring (date-time)
      • engineIdstring
      • marketplaceTemplateIdstring
      • statusstring

        One of: "succeeded", "failed"

  • 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 "$ENGINE_URL/api/workflows/wf_abc123/publish" \
  -H "Authorization: Bearer $TOKEN"

Publish workflow to marketplace

post/api/workflows/{id}/publish

Snapshot and publish the workflow to the medhook.dev community template marketplace. The outbound request is HMAC-SHA256 signed with ANALYTICS_WEBHOOK_SECRET. No PHI leaves: the saved sample and test cases never travel, text copied from a real message is replaced by [redacted] (in the workflow and the changelog), and report says what was left out. Rate limited: 5 req / 60 s.

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

Parameters

NameInTypeDescription
idrequiredpathstring

Workflow ID.

Request body (required)

application/json · object

  • versionstringrequired

    Semver string.

  • changelogstring

Responses

  • 200Workflow published.
    Response fields

    application/json · object

    • publishedbooleanrequired
    • reportarray of string

      What was left out because it came from a real message.

    • versionstringrequired
    • engineIdstring
    • marketplaceResponseobject
      2 fields
      • templateIdstring
      • slugstring
  • 400Request body or query parameters failed validation.

    application/json · ApiError

  • 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

  • 502Marketplace upstream returned a non-2xx. Local audit row is still written.

    application/json · ApiError

Example request

curl
curl -X POST "$ENGINE_URL/api/workflows/wf_abc123/publish" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "version": "1.2.0",
  "changelog": "Added X12 837 routing branch"
}'

Restore a prior version as the draft

post/api/workflows/{id}/rollback

Restores the draft; production keeps running the deployed version until deployed. To restore and deploy in one step use POST /api/workflows/{id}/deploy with action: "rollback". Reverts the live workflow definition to the state captured in a previous WorkflowVersion snapshot. The operation is atomic: the current live state is first snapshotted (making the rollback itself undoable), the workflow definition is overwritten with the target version's nodes/edges/trigger, and a compliance audit log entry is written — all in a single database transaction. Active executions are NOT cancelled; they continue against the version they were started under. After the commit, trigger routes and cron schedules are refreshed, because a workflow that has never been deployed runs the live definition. Rate limited: 10 req / 60 s.

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

Parameters

NameInTypeDescription
idrequiredpathstring

Workflow ID.

Request body (required)

application/json · object

  • versionIdstringrequired

    ID of the WorkflowVersion to restore. Must belong to the workflow identified by :id.

  • reasonstring

    Optional human-readable reason for the rollback. Included in the audit log.

Responses

  • 200Workflow successfully rolled back.
    Response fields

    application/json · object

    • workflowWorkflowrequired

      The updated live workflow definition.

    • fromVersionintegerrequired

      Version number of the snapshot that was restored.

    • toVersionintegerrequired

      Version number of the snapshot that was restored (same as fromVersion).

    • newVersionintegerrequired

      Version number of the newly created pre-rollback snapshot (the state that was live before this rollback, now archived and restorable).

    • deployedboolean

      Always false: this call restores the draft and never deploys.

    • runtimeVersioninteger | null

      The deployed version production keeps running, or null if the workflow has never been deployed (it then runs the restored definition).

  • 400Request body or query parameters failed validation.

    application/json · ApiError

  • 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/workflows/wf_abc123/rollback" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "versionId": "clxyz1234abcdef",
  "reason": "Yesterday'\''s deploy broke ADT message routing"
}'

Read the saved sample message

get/api/workflows/{id}/sample

Decrypts and returns the workflow's sample message. Audited (workflow.sample_read, without content). Viewers get { hasSample, format, bytes, redacted: true } instead: that a sample exists, never its content (G32). With phi=reveal&reason= (the builder Data Map's Show PHI, which masks the sample until then) the read is audited twice, as workflow.sample_read and phi.revealed, the latter with the reason and the patient's keyed hash; a viewer's reveal is 403 PHI_REVEAL_FORBIDDEN, a missing or unknown reason 400, and a reveal that can't be recorded serves nothing (500 PHI_REVEAL_NOT_RECORDED). With view=masked (the builder's read) an operator gets { message, format, phiMasked: true, cursorDates }, the sample with the display masks applied and its structure kept, and cursorDates: each JSON path whose value is a slashed date that does not sort as text (such as 12/31/2026 23:59:59), arrays read through their first item (0), to its layout: slash-date, slash-date-hhmm, slash-date-hhmmss, slash-date-hhmm-12h or slash-date-hhmmss-12h, decided from the layout alone (nothing read from a day, month or time, so samples whose dates differ only in their values answer the same), for the builder's Cursor format hint; audited as workflow.sample_read with masked: true; a reveal wins over it, and any other view is a 400. Without view the answer is unchanged; a signed-in person's raw read also writes message.viewed with the patient's keyed hash and raw: true, while an API client's read writes only workflow.sample_read. Cache-Control: no-store. Rate limited: 60 req / 60 s.

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

Parameters

NameInTypeDescription
idrequiredpathstring

Workflow id (must be in the caller's workspace).

viewquerystring

masked: the sample with the display masks applied (the builder's read).

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

  • 200The sample.
    Response fields

    application/json · object

    • messagestring
    • formatstring | null

      One of: "hl7v2", "json"

    • phiMaskedboolean

      True when message is masked (view=masked).

    • cursorDatesmap of string

      With view=masked: JSON path to the layout of each slashed date that does not sort as text. Decided from the layout alone, never from a value.

  • 403PHI_REVEAL_FORBIDDEN: a viewer's reveal.

    application/json · ApiError

  • 404Workflow not found, or no sample saved.

    application/json · ApiError

Example request

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

Save the sample message

put/api/workflows/{id}/sample

Stores one sample per workflow, AES-256-GCM encrypted. Must be HL7v2 (starting with MSH) or a JSON object, at most 1 MB. Send message, or captureId to save the raw body of a request captured for the New workflow wizard (only the person who minted the capture, in its workspace; 404 otherwise, and once 15 minutes have passed since the captured request arrived). Audited (workflow.sample_saved, with from: "capture" and the captureId for a capture). A capture is not consumed: it can be saved again within those 15 minutes. Rate limited: 20 req / 60 s.

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

Parameters

NameInTypeDescription
idrequiredpathstring

Workflow id (must be in the caller's workspace).

Request body (required)

application/json · object | object

Responses

  • 200Saved.
    Response fields

    application/json · object

    • hasSampleboolean

      One of: true

    • formatstring

      One of: "hl7v2", "json"

    • bytesinteger
    • replacedboolean

      A previous sample was overwritten.

  • 400Missing, too large, or not HL7v2/JSON.

    application/json · ApiError

  • 404Workflow not found, or the capture is unknown, expired or not yours.

    application/json · ApiError

  • 409ifNone was set and the workflow already has a sample.

    application/json · ApiError

Example request

curl
curl -X PUT "$ENGINE_URL/api/workflows/<id>/sample" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "message": "string",
  "ifNone": true
}'

Delete the sample message

delete/api/workflows/{id}/sample

Audited (workflow.sample_deleted). Rate limited: 20 req / 60 s.

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

Parameters

NameInTypeDescription
idrequiredpathstring

Workflow id (must be in the caller's workspace).

Responses

  • 200Deleted.
    Response fields

    application/json · object

    • hasSampleboolean

      One of: false

  • 404Workflow not found in this workspace.

    application/json · ApiError

Example request

curl
curl -X DELETE "$ENGINE_URL/api/workflows/<id>/sample" \
  -H "Authorization: Bearer $TOKEN"

Dry run a workflow on a message

post/api/workflows/{id}/dry-run

Runs the posted message (or, with an empty body, the saved sample) through the trigger's matching rules and then every step, with no side effects: adapters report what they would send and nothing is stored, retried or counted. The response is no-store; the audit entry (workflow.dry_run) records only the outcome. The steps' data, errors and warnings come back masked (phiMasked: true; HL7 field rules, PHI paths and PHI-shaped values) unless phi=reveal&reason= is given: that is audited as phi.revealed (the reason, the patient's keyed hash, part: "run", never a value) before the run; a viewer's reveal is 403 PHI_REVEAL_FORBIDDEN, an unknown reason 400, and a reveal that can't be recorded runs nothing (500 PHI_REVEAL_NOT_RECORDED). A bundled synthetic sample comes back as is. The message is HL7v2 (MSH), JSON, raw X12 (ISA) for an X12 trigger, or any text (CSV, X12, a flat file) for an SFTP or file trigger, wrapped as a live run of that trigger wraps it ({ file, content }, or the first row in rows mode); anything else is a 400. Every adapter step is simulated, except an action its adapter declares side-effect free (a CDA or X12 parse), which runs: a read step (search, read, query, list, get, download) returns one synthetic stand-in record shaped as its result, so the steps after it run (a FHIR search: a searchset Bundle of one resource of the searched type, id dry-run-1, meta.tag code dry-run, an obviously synthetic name; a query: one row of the selected columns valued dry-run; anything else { id: "dry-run-1" }), marked synthetic: true, its step output carries simulatedRead: true, and simulatedReads lists those steps ({ nodeId, nodeName }), so a pass does not prove the reads. A step with no connection chosen previews (needsConnection: true) with a warning instead of failing, and a would-send payload that fails validation completes with a warning in the step's warnings. Step data is what a live run would store (JSON: no undefined values). Rate limited: 20 req / 60 s.

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

Parameters

NameInTypeDescription
idrequiredpathstring

Workflow id (must be in the caller's workspace).

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.

Request body

application/json · object

  • messagestring | object | array of any

    The message: HL7v2 or JSON text, or a JSON object or array (run as its JSON text, up to 1,000,000 characters). A webhook workflow's steps get a JSON message as the live record's data.

    3 fields
    • option 1string
    • option 2object
    • option 3array of any
  • ifNoneboolean

    Only save when the workflow has no sample yet; 409 otherwise.

Responses

  • 200Dry run result.

    application/json · DryRunResult

  • 400Invalid body, no message and no saved sample, or not HL7v2/JSON.

    application/json · ApiError

  • 403PHI_REVEAL_FORBIDDEN: a viewer's reveal.

    application/json · ApiError

  • 404Workflow not found in this workspace.

    application/json · ApiError

  • 500PHI_REVEAL_NOT_RECORDED: the reveal couldn't be recorded; nothing ran.

    application/json · ApiError

Example request

curl
curl -X POST "$ENGINE_URL/api/workflows/<id>/dry-run" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "message": "string",
  "ifNone": true
}'

Fetch a sample from the workflow's source

post/api/workflows/{id}/sample/fetch

On a polling trigger, or a workflow whose first step is an adapter read, runs that read once, live and read-only, through the live poll's own read and item split (no cursor yet, so {{cursor}} params are left out; the source's post-process never runs), and answers the first item with the item count and where the items were (itemsPath: the trigger's itemsPath, the top-level array, Bundle.entry or items). graph is the editor's unsaved state, so it works before a save. Nothing is saved: save the item through PUT .../sample. The connection must be in the caller's workspace (404 otherwise); its calls-per-second limit costs one token; the adapter's SSRF checks apply; the read stops after 15 s (504). An adapter error is a 502 with credentials and upstream bodies removed. 400 NOT_A_READ for any other workflow, an action that sends, or SQL that isn't a SELECT. 403 SAMPLE_FETCH_DISABLED when the engine sets SAMPLE_FETCH_ENABLED=false, and 403 for a caller who may not view message content. Audited as workflow.sample_fetched (source, connection id, item count, outcome; never content). Cache-Control: no-store. Operators. Rate limited: 10 req / 60 s.

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

Parameters

NameInTypeDescription
idrequiredpathstring

Workflow id (must be in the caller's workspace).

Request body

application/json · object

  • graphobject

    The builder's unsaved { trigger, nodes, edges, startNodeId }, validated as for test-steps.

Responses

  • 200The first item (null when the source returned none).
    Response fields

    application/json · object

    • itemany | null
    • itemCountinteger
    • itemsPathstring | null
    • sourceobject
      3 fields
      • kindstring

        One of: "trigger", "step"

      • nodeIdstring
      • adapterProfileIdstring
  • 400NOT_A_READ: not a polling trigger or adapter read.

    application/json · ApiError

  • 403SAMPLE_FETCH_DISABLED, or no permission to view message content.

    application/json · ApiError

  • 404Workflow, or the read's connection, not found in this workspace.

    application/json · ApiError

  • 502SAMPLE_FETCH_FAILED: the adapter's error, redacted.

    application/json · ApiError

  • 504SAMPLE_FETCH_TIMEOUT: the read took over 15 s.

    application/json · ApiError

Example request

curl
curl -X POST "$ENGINE_URL/api/workflows/<id>/sample/fetch" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "graph": {}
}'

Preview a De-identify step on the saved sample

post/api/workflows/{id}/deidentify-preview

Runs the saved sample through a deidentify transform with config (unsaved settings, checked as at save) on the server, with the workspace's pseudonym key, and answers the de-identified output only. Every preset or override field an action keeps shows as [kept], never its value; fields neither covers come back as sent, so the caller needs permission to view message content (403). 422 KEY_REQUIRED when the step needs the key variable and it is missing, not secret or shorter than 16 characters; 422 when the sample is not in the step's format. Audited as workflow.deidentify_previewed (format and counts per action, never content). Cache-Control: no-store. Operators. Rate limited: 30 req / 60 s.

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

Parameters

NameInTypeDescription
idrequiredpathstring

Workflow id (must be in the caller's workspace).

Request body

application/json · object

  • configobject

    The step's settings: preset, format, dates, shiftDays, freeText, zSegments, overrides, keyVariable, maskWith, patientKeyPath.

Responses

  • 200The de-identified sample.
    Response fields

    application/json · object

    • formatstring

      One of: "hl7v2", "fhir", "json"

    • outputstring
    • countsmap of integer

      How many values each action touched.

    • warningsarray of string
  • 400Settings that cannot run.

    application/json · ApiError

  • 403No permission to view message content.

    application/json · ApiError

  • 404Workflow not found, or no sample saved.

    application/json · ApiError

  • 422KEY_REQUIRED, or a sample the step cannot read.

    application/json · ApiError

Example request

curl
curl -X POST "$ENGINE_URL/api/workflows/<id>/deidentify-preview" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "config": {}
}'

Generate the webhook trigger's signing secret

post/api/workflows/{id}/webhook-secret

Generates a random HMAC-SHA256 signing secret for the workflow's webhook trigger and returns it once (Cache-Control: no-store); the trigger stores it sealed and reads show __set__. Callers sign the raw body and send it in x-hub-signature-256 (sha256=<hex>, or x-webhook-signature). Calling it again replaces the secret. A deployed workflow runs its deployed version's trigger, so a new secret takes effect at the next deploy (note says so). Without a secret or an API client every call to the webhook is 401 SIGNATURE_REQUIRED. Audited as workflow.webhook_secret_generated { webhookId, rotated }, never the value. 400 when the trigger is not a webhook. Operators. Rate limited: 10 req / 60 s.

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

Parameters

NameInTypeDescription
idrequiredpathstring

Workflow id (must be in the caller's workspace).

Responses

  • 201The new secret, shown once.
    Response fields

    application/json · object

    • secretstring
    • headerstring
    • formatstring
    • notestring
  • 400The trigger is not a webhook.

    application/json · ApiError

  • 404Workflow not found in this workspace.

    application/json · ApiError

Example request

curl
curl -X POST "$ENGINE_URL/api/workflows/<id>/webhook-secret" \
  -H "Authorization: Bearer $TOKEN"

Export as a Mirth Connect channel

get/api/workflows/{id}/export/mirth

The workflow as a Mirth Connect channel (parallel run or rollback) and a fidelity report: every element that doesn't map exactly, in plain words. Verified in CI by importing and deploying every built-in template in Open Integration Engine 4.5.2, and running a message through each channel template; 3.12.0 output is verified through OIE 4.5.2's import migration, not a real Mirth 3.12. A workflow imported from Mirth keeps its original channel id. Adapter profiles are read from the caller's workspace only. Credentials in adapter profiles and headers are never exported; the report flags anything else that looks like one. No PHI: text copied from the saved sample or a test case from a real message (HL7 v2, X12, CDA or FHIR patient fields, in any case) is replaced by [redacted] in the workflow and its code tables before the XML is written (ids, ports and element names are never touched), and the report says how many test cases from real messages were left out (Mirth has no test cases). Audited as workflow.exported with counts only. Rate limited: 30 req / 60 s.

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

Parameters

NameInTypeDescription
idrequiredpathstring

Workflow id (must be in the caller's workspace).

versionquerystring

Mirth version to write (4.5 and 3.12 also accepted).

formatquerystring

xml: a download. json: { version, filename, channelId, xml, report }.

Responses

  • 200Channel XML (`attachment; filename=<sanitized name>.mirth.xml`; `X-Export-Warnings` = report entries), or the JSON form.

    application/xml · string

    Response fields

    application/json · object

    • versionstring
    • filenamestring
    • channelIdstring
    • xmlstring
    • reportarray of object
      3 fields
      • elementstring
      • kindstring

        One of: "approximated", "not-exported", "credential-placeholder", "medhook-only-api", "disabled", "needs-setup"

      • messagestring
  • 400Unsupported `version` or `format`.

    application/json · ApiError

  • 404Workflow not found in this workspace.

    application/json · ApiError

Example request

curl
curl "$ENGINE_URL/api/workflows/<id>/export/mirth" \
  -H "Authorization: Bearer $TOKEN"

Export several workflows as a Mirth server configuration or a .zip

post/api/workflows/export/mirth

Workflows of the caller's workspace as one Mirth <serverConfiguration> in a "MedHook export" channel group; each MLLP / HTTP listener gets its own port and no two channels share an id. Any id outside the workspace is a 404 and nothing is exported. Restoring it in Mirth replaces the whole server configuration (the report says so). Same version / format query as the single export. Verified in CI in Open Integration Engine 4.5.2 by importing its channels one at a time (a Channel Writer reaches its sibling channel); restoring the whole file is not verified. No PHI: text copied from the saved sample or a test case from a real message (HL7 v2, X12, CDA or FHIR patient fields, in any case) is replaced by [redacted] in the workflow and its code tables before the XML is written (ids, ports and element names are never touched), and the report says how many test cases from real messages were left out (Mirth has no test cases). Audited as workflow.exported with counts only. Rate limited: 10 req / 60 s.

format=zip (Migration › Export to Mirth), stripped the same way: one channel XML per workflow under channels/, the shared libraries their steps pin (caller's workspace only) as Mirth code template libraries under code-templates/, enabled for the channels that pin them (includeCodeTemplates), and a README.md listing the credentials and settings to enter in Mirth, never their values (includeReadme). Audited as workflow.exported with format: "zip", codeTemplates and readme. format=report: what that zip would hold, with each channel's fidelity report and step count, the code templates, and pinned (every library the workflows pin, carried or not, with the workflows that pin it), and no XML; not audited (nothing leaves the engine), rate limited separately at 60 req / 60 s (the tab plans the selection again as it changes).

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

Parameters

NameInTypeDescription
versionquerystring

Mirth version to write (4.5 and 3.12 also accepted).

formatquerystring

xml: the server configuration download. json: { version, filename, xml, report, channels: [{ workflowId, name, channelId, report }] }. zip: the .zip download. report: the .zip's plan as JSON.

includeCodeTemplatesqueryboolean

zip / report: carry the pinned shared libraries as code template libraries (true/false, 1/0).

includeReadmequeryboolean

zip / report: add README.md with the credentials to enter (true/false, 1/0).

Request body (required)

application/json · object

  • idsarray of stringrequired

Responses

  • 200`medhook-channels.mirth.xml`; `medhook-mirth-4.5-export.zip` / `medhook-mirth-3.12-export.zip` (headers `X-Export-Channels`, `X-Export-Code-Templates`, `X-Export-Warnings`); or JSON: `{ version, filename, xml, report, channels }` for `json`, `{ version, filename, report, channels: [{ workflowId, name, channelId, steps, report }], codeTemplates: [{ name, functions }], pinned: [{ name, functions, workflowIds }] }` for `report`.

    application/xml · string

    application/zip · string (binary)

    Response fields

    application/json · object

    • versionstring
    • filenamestring
    • xmlstring
    • reportarray of object
      3 fields
      • elementstring
      • kindstring

        One of: "approximated", "not-exported", "credential-placeholder", "medhook-only-api", "disabled", "needs-setup"

      • messagestring
    • channelsarray of object
      4 fields
      • workflowIdstring
      • namestring
      • channelIdstring
      • reportarray of object
        3 fields
        • elementstring
        • kindstring

          One of: "approximated", "not-exported", "credential-placeholder", "medhook-only-api", "disabled", "needs-setup"

        • messagestring
  • 400Bad body, `version`, `format`, `includeCodeTemplates` or `includeReadme`.

    application/json · ApiError

  • 404Workflow not found in this workspace.

    application/json · ApiError

Example request

curl
curl -X POST "$ENGINE_URL/api/workflows/export/mirth" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "ids": [
    "string"
  ]
}'

Export a workflow as MedHook JSON

get/api/workflows/{id}/export

Downloads the saved workflow as a bundle (version: 2.0, Content-Disposition: attachment): the code tables it uses (with entries), its mapping sets (never sampleData, which can hold PHI) and references to its adapter profiles (id, name and type; never config, hosts or secrets). Everything is read from the caller's workspace only. Trigger secrets are the __set__ marker. No PHI: the saved sample and test cases from real messages are left out (test cases on a bundled synthetic sample travel by reference in dependencies.testCases), and text copied from such a message (HL7 v2, X12, CDA or FHIR patient fields, in any case) is replaced by [redacted] in the workflow, mapping sets, code-table entries and profile names; metadata.report and the X-Export-Left-Out / X-Export-Values-Removed / X-Export-Unchecked headers give the counts (X-Export-Unchecked: real messages in a format that could not be read, such as plain text). An import of the bundle as a new workflow saves its testCases. Audited as workflow.exported with format: medhook-json and counts only. Rate limited: 30 req / 60 s.

Minimum role: viewer.

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

Parameters

NameInTypeDescription
idrequiredpathstring

Workflow id (must be in the caller's workspace).

Responses

  • 200The bundle.
    Response fields

    application/json · object

    • versionstringrequired

      1.0 (workflow only) or 2.0 (with dependencies).

      One of: "1.0", "2.0"

    • exportedAtstring (date-time)
    • workflowobjectrequired

      The workflow graph. Trigger secrets are the __set__ marker.

    • dependenciesobject
      4 fields
      • codeTablesarray of object
        2 fields
        • namestring
        • entriesobject
      • mappingSetsarray of object
        5 fields
        • namestring
        • sourceFormatstring
        • targetFormatstring
        • mappingsarray of object
        • aiGeneratedboolean
      • adapterProfilesarray of object
        3 fields
        • refstringrequired

          The profile's id in the source workspace.

        • namestringrequired
        • adapterTypestringrequired
      • testCasesarray of object
        5 fields
        • namestringrequired
        • samplestringrequired

          A bundled synthetic sample, never message text.

          One of: "adt-a01", "siu-s12"

        • stepIdsarray of string
        • startAtstring

          One of: "message", "step-input"

        • expectedobject
    • metadataobject

      report: what was left out because it came from a real message.

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

    application/json · ApiError

  • 404Not found in the caller's workspace.

    application/json · ApiError

  • 500Unexpected server error.

    application/json · ApiError

Example request

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

Import a MedHook JSON bundle

post/api/workflows/import

Imports a bundle (v1.0 or v2.0) into the caller's workspace in one transaction. Code tables: a missing one is created, an equal one reused, a differing one kept with a warning unless overwriteCodeTables. Adapter profiles: profileMap[ref], else the unique profile with the same name and type, else unresolved (the source id stays and Deploy refuses that destination). The workflow gets a new id and is turned off; trigger secrets are dropped and must be set again (a sealed enc:v1: value is a 422), and a webhook id already used on this engine is replaced. preview: true returns the same plan and writes nothing. Audited as workflow.imported with source: bundle. Rate limited: 10 req / 60 s.

Minimum role: operator.

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

Request body (required)

application/json · object

  • bundleobjectrequired
    5 fields
    • versionstringrequired

      1.0 (workflow only) or 2.0 (with dependencies).

      One of: "1.0", "2.0"

    • exportedAtstring (date-time)
    • workflowobjectrequired

      The workflow graph. Trigger secrets are the __set__ marker.

    • dependenciesobject
      4 fields
      • codeTablesarray of object
        2 fields
        • namestring
        • entriesobject
      • mappingSetsarray of object
        5 fields
        • namestring
        • sourceFormatstring
        • targetFormatstring
        • mappingsarray of object
        • aiGeneratedboolean
      • adapterProfilesarray of object
        3 fields
        • refstringrequired

          The profile's id in the source workspace.

        • namestringrequired
        • adapterTypestringrequired
      • testCasesarray of object
        5 fields
        • namestringrequired
        • samplestringrequired

          A bundled synthetic sample, never message text.

          One of: "adt-a01", "siu-s12"

        • stepIdsarray of string
        • startAtstring

          One of: "message", "step-input"

        • expectedobject
    • metadataobject

      report: what was left out because it came from a real message.

  • profileMapobject

    Profile reference → profile id in the target workspace. Ids outside the target workspace are ignored.

  • overwriteCodeTablesboolean

    Overwrite code tables that exist with different entries (audited). Default: keep them and warn.

  • previewboolean

    Return the plan and write nothing.

Responses

  • 201Imported (200 with `{ plan, warnings }` for a preview).
    Response fields

    application/json · object

    • workflowobject
      2 fields
      • idstring
      • namestring
    • planobject
      4 fields
      • codeTablesarray of object
        2 fields
        • namestring
        • actionstring

          One of: "create", "reuse", "differs", "overwrite", "missing"

      • profilesarray of object
        4 fields
        • refstring
        • namestring
        • adapterTypestring
        • resolvedTostring | null
      • secretsResetarray of string
      • webhookIdChangedboolean
    • warningsarray of string
  • 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

  • 422The request is well formed but cannot be processed.

    application/json · ApiError

  • 500Unexpected server error.

    application/json · ApiError

Example request

curl
curl -X POST "$ENGINE_URL/api/workflows/import" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "bundle": {
    "version": "1.0",
    "exportedAt": "2026-01-01T00:00:00Z",
    "workflow": {},
    "dependencies": {
      "codeTables": [
        {
          "name": "string",
          "entries": {}
        }
      ],
      "mappingSets": [
        {
          "name": "string",
          "sourceFormat": "string",
          "targetFormat": "string",
          "mappings": [
            {}
          ],
          "aiGenerated": true
        }
      ],
      "adapterProfiles": [
        {
          "ref": "string",
          "name": "string",
          "adapterType": "string"
        }
      ],
      "testCases": [
        {
          "name": "string",
          "sample": "adt-a01",
          "stepIds": [
            "string"
          ],
          "startAt": "message",
          "expected": {}
        }
      ]
    },
    "metadata": {}
  },
  "profileMap": {},
  "overwriteCodeTables": true,
  "preview": true
}'

Promote a workflow to another workspace, with a diff

post/api/workflows/{id}/promote

Admin only. Promotes the workflow and what it depends on (the topics it publishes to or subscribes from, a linked template, the workflows its Call workflow steps call, at the version each call runs, and the components its Component steps pin, at the pinned release; the copy's calls and Component steps point at their copies in the target. A component already in the target with the pinned release is reused; otherwise it lands there as a draft component, released on its page there, and the preview's warnings name the release to cut) to targetWorkspaceId as one bundle, in one transaction, with the same rules as POST /api/workflows/import for code tables, mapping sets and trigger secrets. The copy in the target is matched by the workflow's stable key (a slug set on its first promotion); topics by name; a dependency already in the target with the same settings is reused, a differing topic is kept with a warning. Connections are mapped, never copied: profileMap[ref], else the mapping remembered from the last promotion between the two workspaces, else the unique profile with the same name and type. preview: true writes nothing and returns { key, sourceVersion, target, diff, dependencies, connections, senders, plan, warnings, fingerprint } (target.draftWaiting: a newer undeployed draft there is replaced; it stays in Versions). Send the preview's fingerprint back as expectedFingerprint: if anything changed since (a source edit, a deploy or edit there, another promotion), the call is a 409 with code: PREVIEW_STALE and nothing is written; two first promotions at once make one copy and the other gets the same 409. The sender table is per environment: a new copy starts from the source's, an existing copy keeps its own (senders gives the row counts). The first promotion creates a copy that is turned off (201); a later one updates it as a new draft version (200). Nothing is deployed: Deploy in the target runs its test cases and needs approval. If that copy is turned on but was never deployed, the call is a 409. A new key is unique across all workspaces, so unrelated workflows that share a name never match each other's copy. A component (kind: component) is promoted the same way, with the components it uses, and lands as a draft component. Audited as promotion.applied in both workspaces. Rate limited: 10 req / 60 s.

Minimum role: admin.

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

Parameters

NameInTypeDescription
idrequiredpathstring

Workflow id (must be in the caller's workspace).

Request body (required)

application/json · object

  • targetWorkspaceIdstringrequired

    A different workspace's id.

  • profileMapobject

    Profile reference → profile id in the target workspace. Ids outside the target workspace are ignored.

  • overwriteCodeTablesboolean

    Overwrite code tables that exist with different entries (audited). Default: keep them and warn.

  • previewboolean

    Return the plan and write nothing.

  • expectedFingerprintstring

    The preview's fingerprint: promote only if nothing changed since (else 409 PREVIEW_STALE).

Responses

  • 201Created in the target (200 when the existing copy was updated as a draft, or the preview).
    Response fields

    application/json · object

    • promotionIdstring
    • workflowobject
      2 fields
      • idstring
      • namestring
    • targetWorkspaceIdstring
    • targetVersioninteger

      The draft version number it landed as.

    • createdboolean
    • keystring

      The stable key that matches it across workspaces.

    • diffobject
      3 fields
      • linesarray of object
        2 fields
        • opstring

          One of: "same", "add", "del"

        • textstring
      • countsobject
        2 fields
        • addedinteger
        • removedinteger
      • changedboolean

        False when the target already has exactly this.

    • dependenciesarray of object
      6 fields
      • kindstring

        One of: "topic", "template", "component", "workflow"

      • keystring

        The stable key it is matched by.

      • labelstring
      • actionstring

        One of: "create", "reuse", "update", "keep", "differs", "missing"

      • notestring

        For a topic: publishes, subscribes or both. For a component or a called workflow: the release it travels at.

      • draftWaitingboolean

        A component whose draft in the target has changes no release there has: the update replaces it (it stays in Versions there).

    • connectionsarray of object
      6 fields
      • refstring

        The profile's id in the source workspace.

      • namestring
      • adapterTypestring
      • resolvedTostring

        The target profile's id, or null when not mapped.

      • resolvedNamestring
      • mappedBystring

        One of: "picked", "saved", "name"

    • planobject
      4 fields
      • codeTablesarray of object
        2 fields
        • namestring
        • actionstring

          One of: "create", "reuse", "differs", "overwrite", "missing"

      • profilesarray of object
        4 fields
        • refstring
        • namestring
        • adapterTypestring
        • resolvedTostring | null
      • secretsResetarray of string
      • webhookIdChangedboolean
    • warningsarray of string
  • 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

  • 422The request is well formed but cannot be processed.

    application/json · ApiError

  • 500Unexpected server error.

    application/json · ApiError

Example request

curl
curl -X POST "$ENGINE_URL/api/workflows/<id>/promote" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "targetWorkspaceId": "string",
  "profileMap": {},
  "overwriteCodeTables": true,
  "preview": true,
  "expectedFingerprint": "string"
}'

Deployment history per environment

get/api/workflows/{id}/deployments

The workflow's environments: its own workspace and, for an admin, its promoted copies in other workspaces (same stable key). Each with the deployed version, whether a newer draft is waiting, its deployments (newest first, with where a promoted version came from) and the rollback target (the previous deployed version).

Minimum role: viewer.

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

Parameters

NameInTypeDescription
idrequiredpathstring

Workflow id (must be in the caller's workspace).

Responses

  • 200The environments.
    Response fields

    application/json · object

    • environmentsarray of object
      9 fields
      • workspaceobject
        3 fields
        • idstring
        • namestring
        • colorstring
      • workflowIdstring
      • namestring
      • currentboolean
      • deployedVersioninteger
      • liveVersioninteger
      • draftWaitingboolean
      • historyarray of object
        10 fields
        • idstring
        • versioninteger
        • previousVersioninteger
        • kindstring

          One of: "deploy", "rollback"

        • rollbackTointeger
        • overrideboolean
        • promotionIdstring
        • promotedFromobject
          2 fields
          • workspaceNamestring
          • versioninteger
        • deployedBystring
        • deployedAtstring (date-time)
      • rollbackobject
        2 fields
        • versioninteger
        • versionIdstring
  • 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

  • 500Unexpected server error.

    application/json · ApiError

Example request

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

Roll back to the previous deployed version

post/api/workflows/{id}/deployments

One-click rollback: restores the previous deployed version and deploys it, through the same rules as POST /api/workflows/{id}/deploy with action: rollback (it must validate, and every destination needs a profile in the workspace). Viewers can't. 409 when there is no earlier deployment (or its version is no longer kept). Audited as promotion.rolled_back, workflow.rollback and workflow.deployed. Rate limited with deploys: 10 req / 60 s.

Minimum role: operator.

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

Parameters

NameInTypeDescription
idrequiredpathstring

Workflow id (must be in the caller's workspace).

Request body (required)

application/json · object

  • actionstringrequired

    One of: "rollback"

  • reasonstring

    Kept in the audit trail (500 characters).

Responses

  • 200Rolled back: the new live version number, deployed.
    Response fields

    application/json · object

    • currentinteger
    • deploymentobject
  • 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/workflows/<id>/deployments" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "action": "rollback",
  "reason": "string"
}'

A workflow's sender settings

get/api/workflows/{id}/senders

One workflow, many senders: the sender table, keyed by MSH-4 and optionally MSH-3. A row with MSH-3 beats the MSH-4 row, which beats the default row (*); the default row's values sit under the matched row's.

Minimum role: viewer.

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

Parameters

NameInTypeDescription
idrequiredpathstring

Workflow id in the caller's workspace.

Responses

  • 200The sender table.
    Response fields

    application/json · object

    • sendersarray of object
      4 fields
      • facilitystringrequired

        MSH-4 (first component). "*" is the default row.

      • applicationstring

        MSH-3 (first component). Omit for any application.

      • labelstring

        A name for people, never read by a step.

      • valuesobjectrequired

        Key → value, read as {{sender.key}} in step settings and sender.key in JavaScript.

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

    application/json · ApiError

  • 404Not found in the caller's workspace.

    application/json · ApiError

  • 500Unexpected server error.

    application/json · ApiError

Example request

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

Replace a workflow's sender settings

put/api/workflows/{id}/senders

Replaces the table (an empty list removes it). Applies to the next message, with no new version and no deploy. A step that reads a key the sender has no value for, or a sender no row matches, fails and is not retried. Values are settings, not secrets: put a secret in a workspace variable and its {{env.NAME}} in the value. Audited as workflow.senders_changed (count and keys, never values).

Minimum role: operator.

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

Parameters

NameInTypeDescription
idrequiredpathstring

Workflow id in the caller's workspace.

Request body (required)

application/json · object

  • sendersarray of object
    4 fields
    • facilitystringrequired

      MSH-4 (first component). "*" is the default row.

    • applicationstring

      MSH-3 (first component). Omit for any application.

    • labelstring

      A name for people, never read by a step.

    • valuesobjectrequired

      Key → value, read as {{sender.key}} in step settings and sender.key in JavaScript.

Responses

  • 200The saved table.
    Response fields

    application/json · object

    • sendersarray of object
      4 fields
      • facilitystringrequired

        MSH-4 (first component). "*" is the default row.

      • applicationstring

        MSH-3 (first component). Omit for any application.

      • labelstring

        A name for people, never read by a step.

      • valuesobjectrequired

        Key → value, read as {{sender.key}} in step settings and sender.key in JavaScript.

  • 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

  • 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 PUT "$ENGINE_URL/api/workflows/<id>/senders" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "senders": [
    {
      "facility": "string",
      "application": "string",
      "label": "string",
      "values": {}
    }
  ]
}'

Linked template status and update preview

get/api/workflows/template-updates

With workflowId: link, the template the workflow was made from (the version it took, the newest, updateAvailable), and template, the workflow as a template (its linked workflows). With templateId (a workflow or gallery template id): template. With templateId and preview: preview.from and preview.to, the linked workflow's definition now and after the update.

Minimum role: viewer.

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

Parameters

NameInTypeDescription
workflowIdquerystring

A workflow in the caller's workspace.

templateIdquerystring

A workflow or gallery template id.

previewquerystring

A linked workflow id to preview the update for.

Responses

  • 200The status, or the preview.
    Response fields

    application/json · object

    • linkobject | null
      6 fields
      • templateIdstring
      • templateNamestring | null
      • kindstring | null
      • templateVersionstring | null
      • latestVersionstring | null
      • updateAvailableboolean
    • templateobject | null
      6 fields
      • idstring
      • namestring
      • kindstring

        workflow or gallery.

      • versionstring

        A workflow template's live version, or a gallery version.

      • linkedarray of object
        5 fields
        • idstring
        • namestring
        • templateVersionstring | null
        • updateAvailableboolean
        • deployedVersioninteger | null
      • pendinginteger

        Linked workflows with an update.

    • previewobject
      3 fields
      • workflowIdstring
      • fromobject

        The workflow graph now.

      • toobject

        The workflow graph after the update.

  • 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

  • 500Unexpected server error.

    application/json · ApiError

Example request

curl
curl "$ENGINE_URL/api/workflows/template-updates" \
  -H "Authorization: Bearer $TOKEN"

Update all linked workflows

post/api/workflows/template-updates

Applies the template to every linked workflow (or workflowIds). Each takes the template's steps and wiring and keeps its own name, trigger, destination profiles, sender table and test cases. A destination step new in the template takes the profile given in bindings, else none (never the template's own). Its saved test cases are dry-run against the result first; a workflow that fails validation or a case, has an active destination without a usable profile, was saved while the update ran, or hits an error is held back unchanged. An updated workflow gets a new draft version and nothing is deployed: a deployed workflow keeps running its deployed version until it is deployed through the usual checklist. Audited as workflow.template_update with the workflows updated and held back.

Minimum role: operator.

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

Request body (required)

application/json · object

  • templateIdstringrequired
  • workflowIdsarray of string
  • bindingsmap of map of string

    Workflow id → step id → adapter profile id, for destination steps a linked workflow has no profile for.

Responses

  • 200What changed.
    Response fields

    application/json · object

    • templateVersionstring
    • updatedarray of object
      6 fields
      • idstring
      • namestring
      • fromTemplateVersionstring | null
      • versioninteger

        The workflow's new newest (draft) version.

      • deployedVersioninteger | null

        Unchanged: the version production runs until the draft is deployed.

      • testCasesobject | null
        3 fields
        • totalinteger
        • passedinteger
        • failedinteger
    • heldBackarray of object
      5 fields
      • idstring
      • namestring
      • reasonstring

        profiles, validation, test-cases, changed (saved while the update ran) or error.

      • testCasesobject
        3 fields
        • totalinteger
        • passedinteger
        • failedinteger
      • issuesarray of string
    • upToDatearray of object
      2 fields
      • idstring
      • namestring
  • 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

  • 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/workflows/template-updates" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "templateId": "string",
  "workflowIds": [
    "string"
  ],
  "bindings": {}
}'

A workflow's releases

get/api/workflows/{id}/releases

Releases of a callable workflow, newest first: semver labels on deployed versions. A Call workflow step pins a release or follows the newest one (latest); deploying alone changes nothing for callers.

Minimum role: viewer.

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

Parameters

NameInTypeDescription
idrequiredpathstring

Workflow id in the caller's workspace.

Responses

  • 200The releases.
    Response fields

    application/json · object

    • releasesarray of object
      6 fields
      • idstring
      • labelstring

        Semver label, e.g. 1.2.0.

      • versioninteger

        The deployed integer version it points at.

      • notesstring | null
      • createdBystring | null
      • createdAtstring

        ISO 8601.

    • deployedVersioninteger | null
    • suggestedobject
      3 fields
      • patchstring
      • minorstring
      • majorstring
    • canReleaseboolean

      Whether the caller may cut a release.

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

    application/json · ApiError

  • 404Not found in the caller's workspace.

    application/json · ApiError

  • 500Unexpected server error.

    application/json · ApiError

Example request

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

Release the deployed version

post/api/workflows/{id}/releases

Labels the deployed version (it passed the Deploy checklist and approval) as a release. The label must be semver and higher than every earlier release. A workflow that was never deployed is refused (409), as is a deployed version that is already released. Audited as workflow.release_created.

Minimum role: operator.

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

Parameters

NameInTypeDescription
idrequiredpathstring

Workflow id in the caller's workspace.

Request body (required)

application/json · object

  • labelstringrequired

    e.g. 1.2.0

  • notesstring

    What changed.

Responses

  • 201The release.
    Response fields

    application/json · object

    • releaseobject
      6 fields
      • idstring
      • labelstring

        Semver label, e.g. 1.2.0.

      • versioninteger

        The deployed integer version it points at.

      • notesstring | null
      • createdBystring | null
      • createdAtstring

        ISO 8601.

  • 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/workflows/<id>/releases" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "label": "string",
  "notes": "string"
}'

Workflows a Call workflow step can call

get/api/workflows/callable

The caller's workspace's workflows with their releases and the contract a call is checked against (the newest release's, else the deployed version's, else the draft's).

Minimum role: viewer.

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

Responses

  • 200The workflows.
    Response fields

    application/json · object

    • workflowsarray of object
      7 fields
      • idstring
      • namestring
      • enabledboolean
      • deployedVersioninteger | null
      • releasesarray of object
        2 fields
        • labelstring
        • versioninteger
      • contractobject

        Inputs and outputs (JSON Schema objects), or null when none are declared.

      • contractFromstring | null

        release, deployed or draft; null without a contract.

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

    application/json · ApiError

  • 500Unexpected server error.

    application/json · ApiError

Example request

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

Components

get/api/components

The workspace's components: reusable groups of steps that workflows insert at a pinned release (Component step), run inline in the caller's execution.

Minimum role: viewer.

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

Responses

  • 200The components.
    Response fields

    application/json · object

    • componentsarray of object
      8 fields
      • idstring
      • namestring
      • descriptionstring | null
      • releasesarray of object
        3 fields
        • labelstring

          Semver, e.g. 1.0.0.

        • versioninteger
        • sendsarray of object

          The release's send steps. A Component step's connection per sender applies to them.

          3 fields
          • idstring
          • labelstring
          • adapterProfileIdstring

            The component's own connection: the default when a workflow sends per sender.

      • contractobject

        Inputs and outputs (JSON Schema objects of named fields), or null.

      • draftChangedboolean

        The draft has changes no release has.

      • usedByinteger

        Workflows that use it.

      • updatedAtstring

        ISO 8601.

  • 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/components" \
  -H "Authorization: Bearer $TOKEN"

Save steps as a component

post/api/components

The picked steps of graph (one step, or steps that follow on from one step, ending in one step; not the start or the router) become a component, released as 1.0.0. A step with a secret typed into its settings is refused (400): connections stay references. Audited as component.created and component.released.

Minimum role: operator.

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

Request body (required)

application/json · object

  • namestringrequired
  • descriptionstring
  • contractobject

    Inputs and outputs (JSON Schema objects of named fields), or null.

  • stepIdsarray of stringrequired
  • fromWorkflowIdstring

    The workflow the steps came from.

  • graphobjectrequired

    { startNodeId, nodes, edges } of the workflow.

Responses

  • 201The component and its first release.
    Response fields

    application/json · object

    • componentobject
      2 fields
      • idstring
      • namestring
    • releaseobject
      6 fields
      • idstring
      • labelstring
      • versioninteger

        The integer version it labels.

      • notesstring | null
      • createdBystring | null
      • createdAtstring

        ISO 8601.

  • 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

  • 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/components" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "string",
  "description": "string",
  "contract": {},
  "stepIds": [
    "string"
  ],
  "fromWorkflowId": "string",
  "graph": {}
}'

A component

get/api/components/{id}

Its draft steps and graph, contract, releases, whether the draft has unreleased changes, and Used by (workflows × release). Steps and contract are edited by saving the draft (PUT /api/workflows/{id}); workflows keep their pinned release.

Minimum role: viewer.

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

Parameters

NameInTypeDescription
idrequiredpathstring

Component id in the caller's workspace.

Responses

  • 200The component.
    Response fields

    application/json · object

    • componentobject
      10 fields
      • idstring
      • namestring
      • descriptionstring | null
      • liveVersioninteger
      • draftChangedboolean
      • contractobject

        Inputs and outputs (JSON Schema objects of named fields), or null.

      • stepsarray of object
        3 fields
        • idstring
        • typestring
        • labelstring
      • graphobject

        The draft's trigger, nodes, edges and start.

      • releasesarray of object
        6 fields
        • idstring
        • labelstring
        • versioninteger

          The integer version it labels.

        • notesstring | null
        • createdBystring | null
        • createdAtstring

          ISO 8601.

      • usedByarray of object
        6 fields
        • workflowIdstring
        • workflowNamestring
        • releasestring

          The release its Component steps pin.

        • stepsinteger

          How many of its steps use that release.

        • deployedboolean

          Pinned in the version that runs.

        • draftboolean

          Pinned in the draft.

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

    application/json · ApiError

  • 404Not found in the caller's workspace.

    application/json · ApiError

  • 500Unexpected server error.

    application/json · ApiError

Example request

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

Delete a component

delete/api/components/{id}

Removes a component no workflow uses; 409 names the workflows that still do. Audited as component.deleted.

Minimum role: operator.

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

Parameters

NameInTypeDescription
idrequiredpathstring

Component id in the caller's workspace.

Responses

  • 200Deleted.
    Response fields

    application/json · object

    • deletedboolean
  • 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 DELETE "$ENGINE_URL/api/components/<id>" \
  -H "Authorization: Bearer $TOKEN"

Release a component

post/api/components/{id}/releases

Runs the component's saved tests on its draft (a failure holds the release back: 409 with testCases), then labels the draft as label (semver, higher than every earlier release). Workflows keep the release they pin until they are updated. 409 when nothing changed since the newest release. Audited as component.released.

Minimum role: operator.

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

Parameters

NameInTypeDescription
idrequiredpathstring

Component id in the caller's workspace.

Request body (required)

application/json · object

  • labelstringrequired

    e.g. 1.1.0

  • notesstring

    What changed.

Responses

  • 201The release.
    Response fields

    application/json · object

    • releaseobject
      6 fields
      • idstring
      • labelstring
      • versioninteger

        The integer version it labels.

      • notesstring | null
      • createdBystring | null
      • createdAtstring

        ISO 8601.

    • testCasesobject

      Test run summary, or 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/components/<id>/releases" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "label": "string",
  "notes": "string"
}'

A release's impact

get/api/workflows/release-updates

Every consumer of a component or callable workflow (workflows, and components that contain it) and the release each pins, in its draft and in what runs, with the contract change from the previous release. A change a consumer relies on (a new required input, a removed or retyped output) is breaking and marks the release major.

Minimum role: viewer.

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

Parameters

NameInTypeDescription
targetIdrequiredquerystring

A component or callable workflow id.

releasequerystring

A release label. Default: the newest.

Responses

  • 200The impact.
    Response fields

    application/json · object

    • impactobject
      7 fields
      • targetobject
        3 fields
        • idstring
        • namestring
        • kindstring

          component or workflow.

      • releasestring
      • previousstring | null

        The release before it.

      • bumpstring

        none, patch, minor or major (from the previous release).

      • contractobject
        2 fields
        • levelstring

          none, minor or major (a breaking change).

        • changesarray of object
          4 fields
          • sidestring

            input or output.

          • fieldstring
          • breakingboolean
          • textstring

            Plain words, e.g. Output "room" was removed.

      • majorboolean

        From the previous release: a major label or a breaking contract change. A consumer several releases behind can still be major on its own (its major).

      • consumersarray of object
        9 fields
        • idstring
        • namestring
        • kindstring

          workflow, or component (a component that contains it).

        • draftReleasesarray of string

          What the draft pins: release labels, or latest / deployed for a Call workflow step that follows the newest release or the deployed version.

        • deployedReleasesarray of string

          What runs: the deployed version, or a component's releases.

        • stepsinteger

          Steps that use it.

        • statusstring

          update-available, up-to-date, follows-newest or follows-deployed (never updated: the author chose to follow).

        • fromstring | null

          With an update available: the oldest release its draft pins, which the update moves from.

        • majorboolean

          With an update available: moving from from is major (a major label or a breaking contract change), so it needs acknowledgeMajor.

    • canUpdateboolean

      This caller may run tests and update (operators and admins).

  • 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

  • 500Unexpected server error.

    application/json · ApiError

Example request

curl
curl "$ENGINE_URL/api/workflows/release-updates?targetId=string" \
  -H "Authorization: Bearer $TOKEN"

Run tests, or update selected/all consumers to a release

post/api/workflows/release-updates

Each consumer with an update available (or workflowIds) gets its pins moved to release. Its saved test cases (whole workflow and Run with sample step cases) run against that first; a consumer that fails a case or validation, was saved while the update ran, or hits an error is held back unchanged with the reason. An updated consumer gets a new draft version: nothing is deployed, so each one then goes through the deploy checklist. A consumer whose update is major (from the oldest release it pins) is held back unless acknowledgeMajor. dryRun (Run tests) checks only and writes nothing, major or not; it answers ready, with major on a consumer that will need the acknowledgement. Same update engine as linked templates. An update is audited as component.update or workflow.call_update.

Minimum role: operator.

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

Request body (required)

application/json · object

  • targetIdstringrequired
  • releasestringrequired

    A release label, e.g. 1.1.0.

  • workflowIdsarray of string
  • acknowledgeMajorboolean
  • dryRunboolean

    Run tests only.

Responses

  • 200What changed, would change, or was held back.
    Response fields

    application/json · object

    • releasestring
    • dryRunboolean
    • updatedarray of object
      5 fields
      • idstring
      • namestring
      • versioninteger

        The consumer's new newest (draft) version.

      • deployedVersioninteger | null

        Unchanged.

      • testCasesobject | null
        3 fields
        • totalinteger
        • passedinteger
        • failedinteger
    • readyarray of object
      4 fields
      • idstring
      • namestring
      • testCasesobject | null
        3 fields
        • totalinteger
        • passedinteger
        • failedinteger
      • majorboolean

        Updating it will need acknowledgeMajor.

    • heldBackarray of object
      5 fields
      • idstring
      • namestring
      • reasonstring

        profiles, validation, test-cases, major, changed or error.

      • testCasesobject
        3 fields
        • totalinteger
        • passedinteger
        • failedinteger
      • issuesarray of string

        Why, in plain words (case names and field names, never values).

    • upToDatearray of object
      2 fields
      • idstring
      • namestring
  • 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

  • 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/workflows/release-updates" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "targetId": "string",
  "release": "string",
  "workflowIds": [
    "string"
  ],
  "acknowledgeMajor": true,
  "dryRun": true
}'

List templates made of components

get/api/templates

The workspace's templates (#405): each with its newest release, parameters, the components and callable workflows it uses, how many workflows were made from it and how many of those have an update.

Minimum role: viewer.

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

Responses

  • 200The templates.
    Response fields

    application/json · object

    • templatesarray of object
      12 fields
      • idstringrequired
      • namestringrequired
      • descriptionstring | null
      • releasestring | null

        Its newest release.

      • releasesarray of stringrequired

        Its release labels, newest first.

      • draftChangedboolean

        Its steps changed since the newest release.

      • parametersobject | null

        The parameters: the contract editor's inputs (#400).

        3 fields
        • typestring

          object.

        • propertiesmap of object
        • requiredarray of string
      • adapterTypesarray of string
      • usesarray of object
        7 fields
        • kindstring

          component or workflow (a Call workflow step).

        • targetIdstring
        • nodeIdstring
        • labelstring
        • releasestring

          The release it pins (latest / deployed for a Call step).

        • namestring | null
        • neweststring | null

          Its newest release.

      • instancesintegerrequired

        Workflows made from it.

      • pendingintegerrequired

        Of those, how many have an update.

      • shapestringrequired

        The pattern its steps follow (the gallery card's pill).

        One of: "receive-forward", "request-respond", "poll-push", "sync", "batch"

    • canEditboolean

      This caller may save, publish and update.

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

    application/json · ApiError

  • 500Unexpected server error.

    application/json · ApiError

Example request

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

Save a workflow as a template

post/api/templates

A copy of the workflow's draft steps becomes a template (trigger secrets, its callable contract and per-sender connections stay behind). It has no parameters and no release yet. Audited as template.created.

Minimum role: operator.

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

Request body (required)

application/json · object

  • namestringrequired
  • descriptionstring
  • fromWorkflowIdstringrequired

Responses

  • 201Saved.
    Response fields

    application/json · object

    • templateobject
      2 fields
      • idstring
      • namestring
  • 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

  • 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/templates" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "string",
  "description": "string",
  "fromWorkflowId": "string"
}'

A template made of components

get/api/templates/{id}

Its draft steps and parameters, what it uses (with the newest releases), its releases, and every workflow made from it with its values and the updates it has.

Minimum role: viewer.

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

Parameters

NameInTypeDescription
idrequiredpathstring

A template's id (its workflow row of kind template).

Responses

  • 200The template.
    Response fields

    application/json · object

    • templateobject
      9 fields
      • idstring
      • namestring
      • draftChangedboolean
      • parametersobject | null

        The parameters: the contract editor's inputs (#400).

        3 fields
        • typestring

          object.

        • propertiesmap of object
        • requiredarray of string
      • adapterTypesarray of string
      • usesarray of object
        7 fields
        • kindstring

          component or workflow (a Call workflow step).

        • targetIdstring
        • nodeIdstring
        • labelstring
        • releasestring

          The release it pins (latest / deployed for a Call step).

        • namestring | null
        • neweststring | null

          Its newest release.

      • releasesarray of object
        3 fields
        • labelstring
        • versioninteger
        • notesstring
      • instancesarray of object
        8 fields
        • idstring
        • namestring
        • templateVersionstring | null

          The template release it took.

        • paramsobject

          Its parameter values.

        • paramsSummarystring
        • templateUpdatestring | null

          A newer template release, if any.

        • releasesarray of object

          Components and callable workflows with a newer release.

          6 fields
          • kindstring
          • targetIdstring
          • namestring
          • fromstring
          • tostring
          • nodeIdsarray of string
        • updateAvailableboolean
      • pendinginteger

        Workflows with an update.

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

    application/json · ApiError

  • 404Not found in the caller's workspace.

    application/json · ApiError

  • 500Unexpected server error.

    application/json · ApiError

Example request

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

Delete a template

delete/api/templates/{id}

Workflows made from it keep running as they are, with no template to update from. Audited as template.deleted.

Minimum role: operator.

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

Parameters

NameInTypeDescription
idrequiredpathstring

A template's id (its workflow row of kind template).

Responses

  • 200Deleted.
    Response fields

    application/json · object

    • deletedboolean
  • 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

  • 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 DELETE "$ENGINE_URL/api/templates/<id>" \
  -H "Authorization: Bearer $TOKEN"

Publish a template release

post/api/templates/{id}/releases

The draft becomes release label (semver, higher than every earlier one). Refused (400) when a step uses {{params.x}} for an undeclared parameter, holds a typed-in secret, or a Component step pins no release; 409 when nothing changed. Audited as template.released.

Minimum role: operator.

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

Parameters

NameInTypeDescription
idrequiredpathstring

A template's id (its workflow row of kind template).

Request body (required)

application/json · object

  • labelstringrequired

    e.g. 1.1.0

  • notesstring

Responses

  • 201Published.
    Response fields

    application/json · object

    • releaseobject
      2 fields
      • labelstring
      • versioninteger
  • 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/templates/<id>/releases" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "label": "string",
  "notes": "string"
}'

Fill in a template (New from template)

post/api/templates/{id}/render

The workflow a template (or a gallery template) makes from parameters and bindings (adapter type → profile id). A built-in made of components installs its bundled components first (audited). Nothing else is written: create it with POST /api/workflows { ...workflow, templateId, templateParams }.

Minimum role: operator.

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

Parameters

NameInTypeDescription
idrequiredpathstring

A template's id (its workflow row of kind template).

Request body (required)

application/json · object

  • namestringrequired
  • parametersobject
  • bindingsobject

    Adapter type → profile id.

Responses

  • 200The workflow to create.
    Response fields

    application/json · object

    • workflowobject
    • templateIdstring
    • templateVersionstring
    • templateParamsobject
    • warningsarray of string
  • 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/templates/<id>/render" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "string",
  "parameters": {},
  "bindings": {}
}'

Update the workflows made from a template

post/api/templates/{id}/update-instances

A newer template release first (each workflow rendered with its own values), then each newer component or callable workflow release, through the one update engine: each workflow's test cases run first and a failure holds it back. Updates are drafts; nothing is deployed. Audited as workflow.template_update and component.update / workflow.call_update.

Minimum role: operator.

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

Parameters

NameInTypeDescription
idrequiredpathstring

A template's id (its workflow row of kind template).

Request body (required)

application/json · object

  • workflowIdsarray of string
  • acknowledgeMajorboolean

Responses

  • 200What changed or was held back.
    Response fields

    application/json · object

    • sourceobject
    • templateobject | null
      3 fields
      • updatedarray of object
      • heldBackarray of object
      • upToDatearray of object
    • releasesarray of object
      3 fields
      • targetobject
      • releasestring
      • resultobject
        3 fields
        • updatedarray of object
        • heldBackarray of object
        • upToDatearray of 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

  • 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/templates/<id>/update-instances" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "workflowIds": [
    "string"
  ],
  "acknowledgeMajor": true
}'

List the sample library

get/api/workflows/{id}/test-steps

The samples Run with sample can use, by name only: the workflow's saved sample, the bundled synthetic messages and the saved test cases, each with its sender (MSH-4) when it has one. senders lists the senders the picker can narrow the library to: the workflow's sender table, its per-sender connection tables and the samples' own. No content.

Minimum role: viewer.

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

Parameters

NameInTypeDescription
idrequiredpathstring

Workflow id.

Responses

  • 200The library.
    Response fields

    application/json · object

    • libraryarray of object
      4 fields
      • idstring
      • labelstring
      • kindstring

        saved, bundled or case

      • senderstring

        The sample's MSH-4; absent when it has none

    • sendersarray of object
      2 fields
      • facilitystring

        MSH-4

      • labelstring

        The sender table row's name, when set

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

    application/json · ApiError

  • 404Not found in the caller's workspace.

    application/json · ApiError

  • 500Unexpected server error.

    application/json · ApiError

Example request

curl
curl "$ENGINE_URL/api/workflows/<id>/test-steps" \
  -H "Authorization: Bearer $TOKEN"

Run steps with a sample

post/api/workflows/{id}/test-steps

Runs one step, or a connected group of steps that start from one step, on a sample and returns each step's input and output. startAt: message (the default) treats the sample as the message as received: the steps before the selection run first, without side effects, and nothing after the selection runs. startAt: step-input uses the sample (JSON, else text) as the first step's input. Nothing is stored or sent: destinations report what they would send and Run workflow steps start nothing, unless sendForReal: true, which makes the selected destinations really send. A stored sample (saved, a test case, a past message) needs permission to view message content (403). graph runs the builder's unsaved edits. A past message must belong to this workflow (else 404). A stored sample is audited as the read it is (message.viewed with the message id, workflow.test_case_read with the case id, workflow.sample_read). Every run, a failed one too, is audited as workflow.step_test with counts, the sample's source and record id, sendForReal and the outcome; never content. With live: true, a dry run on a pasted sample is audited once per person and workflow every 10 minutes instead. A test case pinned from a real message (fromRealMessage) answers masked for every role, with masked: true: the sample and each step's input, output, console lines and errors, as GET .../test-cases/{caseId} masks them. phi=reveal with a reason answers unmasked and is audited as phi.revealed (resourceType test_case, the reason only); if that record can't be written the answer is a 500 with no content. A reveal without a valid reason is a 400 and nothing runs. Every other run answers masked too (phiMasked: true, masked: false): each step's input and output (rawMessage and parsedMessage included), errors and warnings, and the sample, with console lines withheld; a bundled synthetic sample answers as is. phi=reveal with a reason answers it unmasked after writing phi.revealed (the reason, the patient's keyed hash, part: "run", never a value) before anything runs: a viewer's reveal is 403 PHI_REVEAL_FORBIDDEN, and a reveal that can't be recorded runs nothing (500 PHI_REVEAL_NOT_RECORDED). Not cached.

Minimum role: operator.

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

Parameters

NameInTypeDescription
idrequiredpathstring

Workflow id.

phiquerystring

reveal to answer the run unmasked, audited (needs reason).

reasonquerystring

Why PHI is shown: troubleshooting, patient-request or audit.

Request body (required)

application/json · object

  • stepIdsarray of stringrequired
  • sampleobject | object | objectrequired
    3 fields
    • option 1object
      2 fields
      • sourcestringrequired

        pasted

      • messagestringrequired

        HL7v2, JSON or text.

    • option 2object
      2 fields
      • sourcestringrequired

        library

      • idstringrequired

        saved, bundled:adt-a01, bundled:adt-a08, bundled:siu-s12 or case:<test case id> (GET lists them).

    • option 3object
      2 fields
      • sourcestringrequired

        message

      • messageIdstringrequired

        A past message's id.

  • startAtstring

    message (default) or step-input

  • graphobject

    The editor's graph: { trigger, nodes, edges, startNodeId }.

  • sendForRealboolean

    Selected destinations really send. Default false.

  • liveboolean

    The builder's live proof. A dry run on a pasted sample is then audited once per person and workflow every 10 minutes, with coalescedRuns, instead of once per run. Default false.

Responses

  • 200Each selected step's input and output.
    Response fields

    application/json · object

    • statusstring

      The run's status, or not-reached when no selected step ran.

    • errorstring | null
    • earlierStepsinteger

      Steps run before the selection.

    • stoppedAtobject | null
      3 fields
      • nodeIdstring
      • nodeNamestring
      • reasonstring
    • stepsarray of object
      11 fields
      • nodeIdstring
      • nodeNamestring
      • nodeTypestring
      • statusstring

        completed, failed, skipped, or not-run when the sample stopped before it.

      • inputobject

        What the step received.

      • outputobject

        What the step produced.

      • errorstring | null
      • logsarray of string

        A JavaScript step's console lines.

      • warningsarray of string
      • durationMsinteger | null
      • effectstring | null

        dry-run (a destination that reported what it would send), sent (it really sent), not-run-in-test (a Run workflow step: the other workflow isn't started), or null.

    • sendForRealboolean
    • sampleobject
      2 fields
      • sourcestring
      • textstring

        The sample that ran.

    • maskedboolean

      True when the sample is a real message's test case read without a reveal: the content above is masked.

  • 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

  • 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/workflows/<id>/test-steps" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "stepIds": [
    "string"
  ],
  "sample": {
    "source": "string",
    "message": "string"
  },
  "startAt": "string",
  "graph": {},
  "sendForReal": true,
  "live": true
}'

Replay an HL7 export or batch file

post/api/workflows/{id}/replay-batch

Splits a Rhapsody/Mirth message export, an HL7 batch file (FHS/BHS … BTS/FTS) or an MLLP capture (CR, LF or CRLF; ACKs in a capture are skipped) and replays it. mode=dry-run runs every message through the saved workflow's dry run (trigger rules, then every step; nothing is delivered) and returns each output as a field map; with expected (JSON lines: {"controlId"|"index", "output"} per line) each output is diffed field by field. mode=mllp sends each message to host:port at rate per second over one connection and records the ACK code; the target must be listed in MLLP_REPLAY_TARGETS (403 otherwise, or when unset). Limits: 5 MB per file, 500 messages, 240 s of sending per request. Operator or admin only. Responses are no-store; the audit entry (workflow.batch_replayed) records counts only. Rate limited: 5 req / 60 s.

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

Parameters

NameInTypeDescription
idrequiredpathstring

Workflow id (must be in the caller's workspace).

Request body (required)

multipart/form-data · object

  • filestring (binary)required
  • modestringrequired

    One of: "dry-run", "mllp"

  • expectedstring (binary)

    dry-run only: expected output, JSON lines.

  • hoststring

    mllp only.

  • portinteger
  • ratenumber

    mllp only: messages per second.

  • charsetstring

    The file's character set: it is read with it, and in mllp mode sent with it. Omitted: UTF-8, or Windows-1252 when the bytes are not valid UTF-8.

    One of: "utf-8", "iso-8859-1", "windows-1252", "ascii", "msh-18"

Responses

  • 200Per-message results.
    Response fields

    application/json · object

    • modestring

      One of: "dry-run", "mllp"

    • targetstring

      mllp: host:port.

    • summarymap of integer
    • envelopeobject
      3 fields
      • fileHeaderboolean
      • batchesinteger
      • warningsarray of string
    • framingstring

      One of: "mllp", "plain"

    • acksSkippedinteger
    • rejectedarray of object

      Malformed messages: position in the file and a reason (never content).

      2 fields
      • indexinteger
      • reasonstring
    • resultsarray of object
      8 fields
      • indexinteger
      • controlIdstring
      • statusstring

        One of: "ok", "failed"

      • outputstring
      • fieldsmap of string
      • expectedobject
      • ackstring | null
      • errorstring
  • 400Bad mode, target or rate; not HL7 v2 text; too many messages; an expected line that is not JSON; or an MLLP run longer than the per-request limit.

    application/json · ApiError

  • 403Viewer role, or the MLLP target is not in MLLP_REPLAY_TARGETS.

    application/json · ApiError

  • 404Workflow not found in this workspace.

    application/json · ApiError

  • 413`PAYLOAD_TOO_LARGE` — a file over 5 MB.

    application/json · ApiError

Example request

curl
curl -X POST "$ENGINE_URL/api/workflows/<id>/replay-batch" \
  -H "Authorization: Bearer $TOKEN" \
  -F 'file=@file' \
  -F 'mode=dry-run' \
  -F 'expected=@expected'

Deploy state

get/api/workflows/{id}/deploy

The Versions screen state: the version timeline, the deployed marker, the deploy checklist (validation, the newest passing dry run or execution, the saved test cases (testCases: count and newest run), the newest sandbox run when Settings > Environments requires one (sandbox, null otherwise: its result, when it ran and in which workspace), approval, and what is missing: test, test-cases, sandbox, approval), the workflow's environment (its workspace's: production or sandbox; a sandbox deploy needs no approval), the rollback target and what the caller may do. Production runs the deployed version, so a save after a deploy stays a draft until you deploy it. rollout (R23) says whether canary and scheduled deploys are on (enabled: on unless the engine sets CANARY_DEPLOY_ENABLED=false), the canary percents, the running canary (version, percent, startedAt, promotesAt, runs, failed) and the scheduled deploy (version, at, mode, percent). lastDryRun is the newest dry-run-recent result while it still applies (the same live version, against the same deployed version, run after the live save), with at, so Versions keeps holding Deploy after a reload; null otherwise.

Minimum role: viewer.

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

Parameters

NameInTypeDescription
idrequiredpathstring

Workflow id.

Responses

  • 200The state.

    application/json · object

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

    application/json · ApiError

  • 404Not found in the caller's workspace.

    application/json · ApiError

  • 500Unexpected server error.

    application/json · ApiError

Example request

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

Deploy (now, as a canary or later), approve, roll back or dry-run recent messages

post/api/workflows/{id}/deploy

deploy marks the live version deployed and enables the workflow. It needs a valid workflow, a passing test newer than the live save, passing saved test cases when the workflow has any, a passing run of its sandbox copy when Settings > Environments requires one (production workspaces, while a sandbox workspace exists), and approval in a production workspace (a second admin's; in a sandbox workspace anyone with Operator deploys without one); a missing one is a 409 with missing (test, test-cases, sandbox, approval), and code SANDBOX_RUN_REQUIRED when sandbox is among them. env, when given, must be the workflow's workspace's environment, else 409 WRONG_ENVIRONMENT (promote the workflow to deploy it elsewhere). A version (deployed or rolled back to) that calls a connection without the workflow's environment is 409 CONNECTION_ENVIRONMENT with environment and the connections' names in missing; the error says the fix (set the workflow's environment to its workspace's when they differ, else add the environment to the connection in Adapters). The deploy is audited as workflow.deployed with its env. The saved test cases are dry-run during the call (nothing is delivered, at most 50 cases and 30 seconds), audited as workflow.test_cases_run, and a failure carries testCases with the counts and per-case results. A signed-in admin can pass override: true to skip the test, the test cases, the sandbox run and approval (never validation), and the audit log records what was skipped. An API token never can, whatever the client's role: its override is 403 (API tokens can't skip the deploy checklist or its approval), so CI runs a passing dry run, requests approval and deploys once a signed-in admin approved. request-approval asks for approval of the live version. approve approves a pending request; only an admin who is not the requester may do it (403 otherwise). rollback restores versionId and marks it deployed in one step, after validating it; it changes what production runs, so it needs confirm: true (a 400 without it), and an optional reason is kept in the audit trail. dry-run-recent runs the workflow's newest 50 stored messages through the live version as dry runs on the server (nothing is delivered; at most 30 seconds) and, when an older version is deployed, compares each output with that version's. It returns dryRun with counts only (total, delivered, filtered, failed, changed, changedOutside, compared, truncated) and scope, the titles of the steps the diff from the deployed version touches; never message content. changedOutside counts changed outputs where none of those steps came out differently. What a step makes up per run (an MSH-7 from now, a generated MSH-10, FHIR resource ids and the references to them, meta.lastUpdated) is left out of both comparisons, and a message the deployed version itself answers differently on a second run is not counted, so a nondeterministic step never holds Deploy. It is audited as workflow.dry_run_recent with the counts, against (the deployed version it compared with, or null) and truncated, not the titles. The Versions tab holds Deploy while changedOutside is above 0 (OQ-W8); the API does not refuse the deploy, and an admin can override from the tab. A deploy (now, canary or scheduled) while the newest such run of this version has changedOutside above 0 is audited with override: true, "dry-run" in skipped and dryRunChangedOutside, and recorded as an override in the deployment history. Canary and scheduled deploy (R23) are on unless the engine sets CANARY_DEPLOY_ENABLED=false; then starting one is a 409 with code: CANARY_OFF. deploy with rollout: {mode: "canary", percent} (10, 25 or 50, a 400 otherwise) passes the same checks, then runs that share of messages, chosen by message id, on the live version beside the deployed one for 30 minutes; it needs approval even with override, a deployed version and the workflow on (409 otherwise), and is audited as workflow.canary_started. The engine promotes it to every message after 30 minutes under 1% errors (workflow.canary_promoted) and rolls it back on its own at 1% or more (workflow.canary_rolled_back). promote deploys the canary's version now (only the deployed version moves: a workflow turned off stays off) and rollback-canary (with confirm: true) ends it, putting every message back on the deployed version, clearing the canary version's approval (a later save's approval is kept) and recording a rollback in the deployment history; both are a 409 when no canary is running. A canary's errors are its failed and partial runs. deploy with at (an ISO 8601 time in the next 30 days) stores the deploy instead, audited as workflow.deploy_scheduled; it runs when due unless a later save changed the version or, for a canary, the workflow was turned off (workflow.deploy_schedule_cancelled); a new schedule or a canary started now replaces a pending schedule, audited the same way. cancel-schedule clears it. Deploying all at once, or rolling back, ends a running canary and a pending schedule.

Minimum role: operator.

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

Parameters

NameInTypeDescription
idrequiredpathstring

Workflow id.

Request body (required)

application/json · object

  • actionstringrequired

    One of: "deploy", "request-approval", "approve", "rollback", "dry-run-recent", "promote", "rollback-canary", "cancel-schedule"

  • rolloutobject
    2 fields
    • modestringrequired

      One of: "canary", "all"

    • percentinteger

      For a canary: the share of messages.

      One of: 10, 25, 50

  • atstring

    For deploy: schedule it at this ISO 8601 time (next 30 days).

  • overrideboolean

    Admin only. Skips the test, the test cases and approval.

  • versionIdstring

    For rollback.

  • confirmboolean

    For rollback and rollback-canary: required true, the person confirmed it.

  • reasonstring

    For rollback: why, kept in the audit trail.

  • envstring

    The environment you mean to deploy to; must be the workflow's workspace's.

    One of: "production", "sandbox"

  • proposalstring

    For deploy and request-approval: the signed proposal of the Agent card this was opened from. When the action succeeds it is audited ai.proposal.resolved (done, or waiting for the second admin), so the card shows it; one that is not this workflow's is ignored.

Responses

  • 200Done.

    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 -X POST "$ENGINE_URL/api/workflows/<id>/deploy" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "action": "deploy",
  "rollout": {
    "mode": "canary",
    "percent": 10
  },
  "at": "string",
  "override": true,
  "versionId": "string",
  "confirm": true,
  "reason": "string",
  "env": "production",
  "proposal": "string"
}'

List workflow versions

get/api/workflows/{id}/versions

The latest 20 versions, as metadata only (no nodes or edges), plus deployedVersion (null when never deployed) and current, the saved workflow's version number (the newest snapshot + 1).

Minimum role: viewer.

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

Parameters

NameInTypeDescription
idrequiredpathstring

Workflow id.

Responses

  • 200The versions.

    application/json · object

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

    application/json · ApiError

  • 404Not found in the caller's workspace.

    application/json · ApiError

  • 500Unexpected server error.

    application/json · ApiError

Example request

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

Get one workflow version

get/api/workflows/{id}/versions/{version}

A saved version with its full nodes, edges and trigger.

Minimum role: viewer.

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

Parameters

NameInTypeDescription
idrequiredpathstring

Workflow id.

versionrequiredpathstring

Version number.

Responses

  • 200The version.

    application/json · object

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

    application/json · ApiError

  • 404Not found in the caller's workspace.

    application/json · ApiError

  • 500Unexpected server error.

    application/json · ApiError

Example request

curl
curl "$ENGINE_URL/api/workflows/<id>/versions/<version>" \
  -H "Authorization: Bearer $TOKEN"

Restore a workflow version

post/api/workflows/{id}/versions/{version}/rollback

Snapshots the current state as a new version first, so the rollback can be undone, then replaces the nodes, edges and trigger from the chosen version and renames the workflow <name> (restored from v<N>). If the workflow is enabled, every destination step must have an adapter profile in this workspace, or the call is a 400 with details.code of DESTINATION_PROFILE_MISSING.

Minimum role: operator.

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

Parameters

NameInTypeDescription
idrequiredpathstring

Workflow id.

versionrequiredpathstring

Version number.

Responses

  • 200Restored.
    Response fields

    application/json · object

    • successboolean
    • restoredFromVersioninteger
    • workflowWorkflow
  • 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

  • 500Unexpected server error.

    application/json · ApiError

Example request

curl
curl -X POST "$ENGINE_URL/api/workflows/<id>/versions/<version>/rollback" \
  -H "Authorization: Bearer $TOKEN"

Run a workflow with a sample message

post/api/workflows/{id}/replay

Starts the deployed version of an enabled workflow with message as its trigger input, like live traffic. A string is read as HL7v2, plain text or a JSON string; an object is a parsed payload. It answers at once with the new execution, which is pending until the work runner (any replica) starts it; poll GET /api/executions/{id} for the result. The run is not in an ordering lane. Needs a valid license. Rate limited to 30 requests per minute.

Minimum role: operator.

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

Parameters

NameInTypeDescription
idrequiredpathstring

Workflow id.

Request body (required)

application/json · object

  • messagestring | objectrequired
    2 fields
    • option 1string
    • option 2object

Responses

  • 202Started.
    Response fields

    application/json · object

    • executionobject
      3 fields
      • idstring
      • statusstring
      • startedAtstring (date-time)
  • 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

  • 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/workflows/<id>/replay" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "message": "string"
}'

Stored message encryption for a workflow

get/api/workflows/{id}/message-encryption

Whether this workflow's stored messages (execution input, step outputs and step diagnostics) are encrypted at rest with AES-256-GCM: its own encryptMessages setting, whether ENCRYPT_STORED_MESSAGES turns it on for every workflow (forcedByEngine), and the effective result. keyRotatedAt is when the engine key was last rotated (the newest encryption.key_rotated audit event), or null.

Minimum role: viewer.

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

Parameters

NameInTypeDescription
idrequiredpathstring

Workflow id.

Responses

  • 200The setting.
    Response fields

    application/json · object

    • encryptMessagesboolean
    • forcedByEngineboolean
    • effectiveboolean
    • keyRotatedAtstring (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

  • 500Unexpected server error.

    application/json · ApiError

Example request

curl
curl "$ENGINE_URL/api/workflows/<id>/message-encryption" \
  -H "Authorization: Bearer $TOKEN"

Turn stored message encryption on or off for a workflow

put/api/workflows/{id}/message-encryption

Applies to messages stored after the change; rows already stored keep the form they were written in and read either way. Admin only. Audited as workflow.message_encryption_changed with the old and new values.

Minimum role: admin.

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

Parameters

NameInTypeDescription
idrequiredpathstring

Workflow id.

Request body (required)

application/json · object

  • encryptMessagesbooleanrequired

Responses

  • 200Saved.

    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

  • 500Unexpected server error.

    application/json · ApiError

Example request

curl
curl -X PUT "$ENGINE_URL/api/workflows/<id>/message-encryption" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "encryptMessages": true
}'

Execution retention for a workflow

get/api/workflows/{id}/retention

How long this workflow's executions (raw PHI) are kept before the purge deletes them: its own retentionDays, or null for the engine default (EXECUTION_RETENTION_DAYS, engineDefaultDays; 0 means no limit), and the effectiveDays that apply. keepFailedDays keeps failed and partial executions longer (null: they follow the same period); effectiveFailedDays is how long they are actually kept, never less than effectiveDays (0 means no limit). Executions of a deleted workflow fall back to the engine default. storageMode is what a successful run keeps (full: everything; production: the input and the outputs of send and last steps; raw: the input only; metadata: no content); failed, partial and cancelled runs always keep everything, and queuedDestinations true means the workflow's runs store in full whatever the mode. contentRetentionDays removes message content (input, step outputs) after that many days while the run rows stay for the retention period (null: off).

Minimum role: viewer.

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

Parameters

NameInTypeDescription
idrequiredpathstring

Workflow id.

Responses

  • 200The retention.
    Response fields

    application/json · object

    • retentionDaysinteger | null
    • keepFailedDaysinteger | null
    • engineDefaultDaysinteger
    • effectiveDaysinteger
    • effectiveFailedDaysinteger
    • storageModestring

      One of: "full", "production", "raw", "metadata"

    • storageModesarray of string
    • contentRetentionDaysinteger | null
    • queuedDestinationsboolean
    • minDaysinteger
    • maxDaysinteger
  • 401No credential, or the token is invalid or expired.

    application/json · ApiError

  • 404Not found in the caller's workspace.

    application/json · ApiError

  • 500Unexpected server error.

    application/json · ApiError

Example request

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

Set a workflow's execution retention

put/api/workflows/{id}/retention

Sets this workflow's own retention in whole days, from 7 (the ACK queue window) to 3650, or null to use the engine default, and keepFailedDays, the days its failed and partial executions are kept (same bounds; null: the same period). Send either or both; a field left out is unchanged. Failed executions are never deleted sooner than the rest. 0 (keep forever) is not allowed per workflow. The purge applies it even when the engine default is off. storageMode (full, production, raw or metadata) and contentRetentionDays (same bounds, or null for off) are set the same way. Audited as workflow.retention_changed with the old and new values of every setting.

Minimum role: admin.

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

Parameters

NameInTypeDescription
idrequiredpathstring

Workflow id.

Request body (required)

application/json · object

  • retentionDaysinteger | null
  • keepFailedDaysinteger | null
  • storageModestring

    One of: "full", "production", "raw", "metadata"

  • contentRetentionDaysinteger | null

Responses

  • 200Saved.

    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

  • 500Unexpected server error.

    application/json · ApiError

Example request

curl
curl -X PUT "$ENGINE_URL/api/workflows/<id>/retention" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "retentionDays": 7,
  "keepFailedDays": 7,
  "storageMode": "full",
  "contentRetentionDays": 7
}'

A polling trigger's cursor state

get/api/workflows/{id}/poll-cursor

Where the workflow's deployed polling trigger has got to: whether a cursor is stored, how many item ids it remembers, the last and next poll, the last poll error and whether a poll is running now. The cursor value itself is never returned (it is a value from the source). lastError is PHI-safe: quoted values, upstream bodies and URL query values are withheld. lastErrorState is waiting when the poll holds back on purpose (the max in flight, a full backlog) and failed otherwise; lastPolledAt is the last poll that read the source. polling is false when the deployed trigger is not polling.

Minimum role: viewer.

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

Parameters

NameInTypeDescription
idrequiredpathstring

Workflow id.

Responses

  • 200The cursor state.
    Response fields

    application/json · object

    • pollingboolean
    • cursorSetboolean
    • keysRememberedinteger
    • lastPolledAtstring (date-time) | null
    • nextPollAtstring (date-time) | null
    • lastErrorstring | null
    • lastErrorStatestring | null

      One of: "waiting", "failed"

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

    application/json · ApiError

  • 404Not found in the caller's workspace.

    application/json · ApiError

  • 500Unexpected server error.

    application/json · ApiError

Example request

curl
curl "$ENGINE_URL/api/workflows/<id>/poll-cursor" \
  -H "Authorization: Bearer $TOKEN"

Poll from the beginning

delete/api/workflows/{id}/poll-cursor

Resets the polling trigger, like resetting a Mirth channel: forgets the cursor, the item ids remembered at it and the workflow's settled polling duplicate receipts, so the next poll (due at once) runs every item the source returns, including items that already ran. A poll in progress is never interrupted: 409 POLL_IN_PROGRESS, try again in a few seconds. 409 CONFLICT when the deployed trigger is not polling. A workflow that has not polled yet answers reset: false. Operators and admins. Audited as workflow.poll_reset with the number of receipts forgotten. Rate limited to 10 requests per minute.

Minimum role: operator.

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

Parameters

NameInTypeDescription
idrequiredpathstring

Workflow id.

Responses

  • 200Reset (or nothing to reset).
    Response fields

    application/json · object

    • resetboolean
    • forgotteninteger
  • 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 -X DELETE "$ENGINE_URL/api/workflows/<id>/poll-cursor" \
  -H "Authorization: Bearer $TOKEN"

A polling workflow's recent polls

get/api/workflows/{id}/polls

The workflow's newest polls (at most 100), newest first, whether or not they found new items: when each ran, its outcome (ok; failed, waiting or skipped with the kind of cause), how long it took, how many items it read and over how many pages, how many were new, how many runs it started, how many had run before, how many the inbound filter rejected, and whether the cursor moved. Counts and cause classes only: never the cursor value, an item or error text, so viewers read it too. call links to the connection's call-log row of the poll's read (masked request and response) while that log, which keeps its connection's calls for CALL_LOG_RETENTION_HOURS (default 7 days), still holds it. Polls are recorded in the engine event log; recording is false when it, or its trigger family, is turned off (EVENT_LOG_ENABLED, EVENT_LOG_FAMILIES). Workspace-scoped. Rate limited to 60 requests per minute.

Minimum role: viewer.

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

Parameters

NameInTypeDescription
idrequiredpathstring

Workflow id.

limitqueryinteger

How many polls, 1 to 100 (default 100).

Responses

  • 200The polls.
    Response fields

    application/json · object

    • pollingboolean

      The deployed trigger is polling.

    • recordingboolean

      Polls are being recorded on this engine.

    • intervalMsinteger | null

      The trigger's poll interval.

    • pollsarray of object
      13 fields
      • atstring (date-time)
      • outcomestring

        One of: "ok", "failed", "waiting", "skipped"

      • causestring | null

        One of: "read", "unordered", "stalled", "item", "in-flight", "backlog", "license", "phi"

      • durationMsinteger | null
      • itemsinteger

        Items the read returned, every page.

      • pagesinteger
      • newItemsinteger

        Items not run before, taken this poll.

      • raninteger

        Runs started.

      • alreadyRuninteger

        Items that ran on an earlier poll.

      • filteredinteger

        Items the inbound filter rejected.

      • cursorMovedboolean
      • firstPollboolean
      • callobject | null
        3 fields
        • profileIdstring
        • idstring
        • envstring

          One of: "production", "sandbox"

  • 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

  • 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/workflows/<id>/polls" \
  -H "Authorization: Bearer $TOKEN"

List saved test cases

get/api/workflows/{id}/test-cases

The workflow's saved test cases, which the deploy checklist dry-runs. The list carries no case content (inputs are PHI), so viewers and operators get the same list.

Minimum role: viewer.

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

Parameters

NameInTypeDescription
idrequiredpathstring

Workflow id.

Responses

  • 200The cases.
    Response fields

    application/json · object

    • testCasesarray of WorkflowTestCase
    • maxinteger

      At most 50 cases per workflow.

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

    application/json · ApiError

  • 404Not found in the caller's workspace.

    application/json · ApiError

  • 500Unexpected server error.

    application/json · ApiError

Example request

curl
curl "$ENGINE_URL/api/workflows/<id>/test-cases" \
  -H "Authorization: Bearer $TOKEN"

Save a test case

post/api/workflows/{id}/test-cases

Saves an input message (up to 1 MB) and, optionally, what the workflow should produce from it: the whole output, compared field by field, and/or assertions over the output's fields. A case with neither passes when the dry run reaches a destination. A step case (stepIds, from Run with sample) must fit the saved workflow by the same selection rules as a step test, or the request is a 400 with the reason. Input and expected are stored AES-256-GCM encrypted. 409 at 50 cases or on a duplicate name. Audited as workflow.test_case_created with the name only.

Minimum role: operator.

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

Parameters

NameInTypeDescription
idrequiredpathstring

Workflow id.

Request body (required)

application/json · object

  • namestringrequired

    1 to 80 characters, unique in the workflow.

  • inputstring

    The input message. Give exactly one of this, fromExecutionId or fromSample.

  • fromSampleboolean

    true: the workflow's saved sample becomes the input, read on the server (audited workflow.sample_read) so it never goes through the browser. 400 when there is no saved sample.

  • fromExecutionIdstring

    A run of this workflow whose message as received becomes the input, read on the server (Runs › Save as test case). 404 for a run of another workflow, 400 for a run without a message.

  • expectedobject | null
    3 fields
    • outputstring | object

      The whole expected output, compared field by field.

      2 fields
      • option 1string
      • option 2object
    • assertionsarray of object
      3 fields
      • fieldstringrequired

        An output field: SEG.n for HL7v2, a dotted path for JSON.

      • opstringrequired

        One of: "equals", "exists", "absent", "contains"

      • valuestring | integer | boolean
    • stepOutputsobject

      A step case (Run with sample): each step's expected output, by step id.

  • stepIdsarray of string

    Run with sample: test only these steps (connected, starting from one step). Each step's output is compared with expected.stepOutputs.

  • fromRealMessageboolean

    The input is a real message, so the case's read is masked. Default true; send false for a bundled or pasted sample.

  • startAtstring

    With stepIds: message (default; the steps before run first) or step-input (the input is the first step's input).

Responses

  • 201Saved.
    Response fields

    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 -X POST "$ENGINE_URL/api/workflows/<id>/test-cases" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "string",
  "input": "string",
  "fromSample": true,
  "fromExecutionId": "string",
  "expected": {
    "output": "string",
    "assertions": [
      {
        "field": "string",
        "op": "equals",
        "value": "string"
      }
    ],
    "stepOutputs": {}
  },
  "stepIds": [
    "string"
  ],
  "fromRealMessage": true,
  "startAt": "string"
}'

Get a test case

get/api/workflows/{id}/test-cases/{caseId}

One case with its input and expected (an audited read). A case pinned from a real message (fromRealMessage) comes back masked (HL7 patient fields such as PID.3, PID.5 and PID.7; every JSON and FHIR value but resourceType), with masked: true, unless the request carries phi=reveal and a reason; that reveal is audited as phi.revealed (resourceType test_case, the reason only). Viewers get the summary only, with redacted: true (G32).

Minimum role: viewer.

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

Parameters

NameInTypeDescription
idrequiredpathstring

Workflow id.

caseIdrequiredpathstring

Test case id.

phiquerystring

reveal to read a real message's case unmasked (needs reason).

reasonquerystring

Why PHI is shown: troubleshooting, patient-request or audit.

Responses

  • 200The case.

    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

  • 404Not found in the caller's workspace.

    application/json · ApiError

  • 500Unexpected server error.

    application/json · ApiError

Example request

curl
curl "$ENGINE_URL/api/workflows/<id>/test-cases/<caseId>" \
  -H "Authorization: Bearer $TOKEN"

Change a test case

put/api/workflows/{id}/test-cases/{caseId}

Changes the name, input or expected. assertions (the builder's field checks, at most 100) replaces only the case's assertions and keeps its expected output and step outputs; give it or expected, not both, and an empty list removes them. On a case from a real message, a value that still holds a masked read (•••) is a 400. Audited as workflow.test_case_updated with the name and the changed field names (assertions, with assertionCount), never values.

Minimum role: operator.

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

Parameters

NameInTypeDescription
idrequiredpathstring

Workflow id.

caseIdrequiredpathstring

Test case id.

Request body (required)

application/json · object

  • namestring
  • inputstring
  • expectedobject | null
    3 fields
    • outputstring | object

      The whole expected output, compared field by field.

      2 fields
      • option 1string
      • option 2object
    • assertionsarray of object
      3 fields
      • fieldstringrequired

        An output field: SEG.n for HL7v2, a dotted path for JSON.

      • opstringrequired

        One of: "equals", "exists", "absent", "contains"

      • valuestring | integer | boolean
    • stepOutputsobject

      A step case (Run with sample): each step's expected output, by step id.

  • assertionsarray of object

    Replaces only the field checks; the expected output stays.

    3 fields
    • fieldstringrequired

      An output field: SEG.n for HL7v2, a dotted path for JSON.

    • opstringrequired

      One of: "equals", "exists", "absent", "contains"

    • valuestring | integer | boolean

Responses

  • 200Saved.
    Response fields

    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 -X PUT "$ENGINE_URL/api/workflows/<id>/test-cases/<caseId>" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "string",
  "input": "string",
  "expected": {
    "output": "string",
    "assertions": [
      {
        "field": "string",
        "op": "equals",
        "value": "string"
      }
    ],
    "stepOutputs": {}
  },
  "assertions": [
    {
      "field": "string",
      "op": "equals",
      "value": "string"
    }
  ]
}'

Delete a test case

delete/api/workflows/{id}/test-cases/{caseId}

Audited as workflow.test_case_deleted.

Minimum role: operator.

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

Parameters

NameInTypeDescription
idrequiredpathstring

Workflow id.

caseIdrequiredpathstring

Test case id.

Responses

  • 200Deleted.
    Response fields

    application/json · object

    • deletedboolean
  • 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

  • 500Unexpected server error.

    application/json · ApiError

Example request

curl
curl -X DELETE "$ENGINE_URL/api/workflows/<id>/test-cases/<caseId>" \
  -H "Authorization: Bearer $TOKEN"

Run the saved test cases

post/api/workflows/{id}/test-cases/run

Dry-runs every saved case against the live version, the same path as a builder dry run, so nothing is delivered or stored. With graph, the cases run on the builder's unsaved edits instead (the builder re-runs them as you edit), audited with unsaved: true once per person and workflow every 10 minutes, with coalescedRuns counting the runs the previous row folded in. Results carry field names, counts and, for a step case, the ids of the steps it found broken (brokenStepIds), never values. Audited as workflow.test_cases_run with the version and counts. Operators and admins only. Rate limited to 10 requests per minute.

Minimum role: operator.

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

Parameters

NameInTypeDescription
idrequiredpathstring

Workflow id.

Request body (required)

application/json · object

  • graphobject

    Optional. The editor's graph: { trigger, nodes, edges, startNodeId }.

Responses

  • 200The results.

    application/json · WorkflowTestCasesRun

  • 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

  • 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/workflows/<id>/test-cases/run" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "graph": {}
}'

Count the values of one HL7 field

get/api/workflows/{id}/field-values

Value counts for one HL7 field across the workflow's most recent executions, for the builder's rule preview. Messages are PHI, so the response holds only counts for the field you ask for, is never cached, and the audit log records the path, not the values. The counts are message content, so viewers get 403 PHI_FORBIDDEN (G32). The values are masked by default (phiMasked: true), as the field's raw line would show them: names keep initials, ids two characters, a code field such as PV1.2 as it is; one row per distinct value even when two masks read the same. With phi=reveal&reason= they are served as they are, after phi.revealed is written (the reason, part: "field-values", the path, the messages' patient keys, never a value); a reveal that can't be recorded serves nothing (500 PHI_REVEAL_NOT_RECORDED), a bad reason is a 400 and a viewer's reveal a 403 PHI_REVEAL_FORBIDDEN.

Minimum role: viewer.

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

Parameters

NameInTypeDescription
idrequiredpathstring

Workflow id.

pathrequiredquerystring

A field path such as PV1.2.

limitqueryinteger

Executions to read, 1 to 500.

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

  • 200The counts.
    Response fields

    application/json · object

    • pathstring
    • limitinteger
    • messagesinteger
    • valuesarray of object
      2 fields
      • valuestring
      • countinteger
    • otherValuesinteger
    • otherCountinteger
    • phiMaskedboolean

      True when the values are masked.

  • 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

  • 500Unexpected server error.

    application/json · ApiError

Example request

curl
curl "$ENGINE_URL/api/workflows/<id>/field-values?path=string" \
  -H "Authorization: Bearer $TOKEN"

Per-step results of the latest run

get/api/workflows/{id}/last-run

Status and duration of each step of the newest execution, and the branch a condition took. Step output and error text can hold PHI, so neither is returned. A condition branch depends on the message, so viewers get branch: null and redacted: true (G32).

Minimum role: viewer.

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

Parameters

NameInTypeDescription
idrequiredpathstring

Workflow id.

Responses

  • 200The latest run, or `execution: null`.
    Response fields

    application/json · object

    • executionobject | null
      4 fields
      • idstring
      • statusstring
      • startedAtstring (date-time)
      • durationMsinteger
    • stepsarray of object
      4 fields
      • nodeIdstring
      • statusstring
      • durationMsinteger
      • branchstring
  • 401No credential, or the token is invalid or expired.

    application/json · ApiError

  • 404Not found in the caller's workspace.

    application/json · ApiError

  • 500Unexpected server error.

    application/json · ApiError

Example request

curl
curl "$ENGINE_URL/api/workflows/<id>/last-run" \
  -H "Authorization: Bearer $TOKEN"

Step latency percentiles

get/api/workflows/{id}/slow-steps

p50, p95, p99 and max duration of each step over the most recent executions. Cached for 60 seconds.

Minimum role: viewer.

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

Parameters

NameInTypeDescription
idrequiredpathstring

Workflow id.

sampleSizequeryinteger

Executions to sample.

Responses

  • 200The percentiles.
    Response fields

    application/json · object

    • workflowIdstring
    • sampledExecutionsinteger
    • stepsarray of object
      7 fields
      • nodeIdstring
      • nodeNamestring
      • p50Durationnumber
      • p95Durationnumber
      • p99Durationnumber
      • maxDurationnumber
      • sampleCountinteger
  • 401No credential, or the token is invalid or expired.

    application/json · ApiError

  • 404Not found in the caller's workspace.

    application/json · ApiError

  • 500Unexpected server error.

    application/json · ApiError

Example request

curl
curl "$ENGINE_URL/api/workflows/<id>/slow-steps" \
  -H "Authorization: Bearer $TOKEN"

Slowest step of each workflow

get/api/workflows/slow-steps-summary

For each workflow (up to 200), the step with the highest p95 latency over its last 20 executions. Cached for 60 seconds.

Minimum role: viewer.

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

Responses

  • 200The summary.
    Response fields

    application/json · object

    • workflowsarray of object
      6 fields
      • workflowIdstring
      • workflowNamestring
      • slowestStepNamestring
      • slowestStepP95Msnumber
      • executionCountinteger
      • lastExecutionAtstring (date-time)
  • 401No credential, or the token is invalid or expired.

    application/json · ApiError

  • 500Unexpected server error.

    application/json · ApiError

Example request

curl
curl "$ENGINE_URL/api/workflows/slow-steps-summary" \
  -H "Authorization: Bearer $TOKEN"

Import a community template

post/api/workflows/import-marketplace

Fetches the template with this slug from medhook.dev (WEB_APP_URL), checks it, and creates a new workflow in this engine.

Minimum role: operator.

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

Request body (required)

application/json · object

  • slugstringrequired

    Lowercase letters and digits joined by dashes or single dots.

Responses

  • 200Imported.
    Response fields

    application/json · object

    • successboolean
    • workflowWorkflow
    • sourceobject
      2 fields
      • marketplaceboolean
      • slugstring
    • warningsarray of string
  • 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

  • 422The request is well formed but cannot be processed.

    application/json · ApiError

Example request

curl
curl -X POST "$ENGINE_URL/api/workflows/import-marketplace" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "slug": "string"
}'

Preview a transform pipeline

post/api/transforms/preview

Runs a flat object through the visual transform builder's operations one step at a time and returns each step's output, so the builder can show a card per step. Rate limited to 30 requests per minute.

Minimum role: operator.

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

Request body (required)

application/json · object

  • inputobjectrequired

    A flat data object.

  • operationsarray of objectrequired

    The builder's operations, in order.

Responses

  • 200The steps.
    Response fields

    application/json · object

    • stepsarray of object
      7 fields
      • indexinteger
      • opTypestring
      • labelstring
      • summarystring
      • outputobject | null
      • errorstring | null
      • skippedboolean
    • finalOutputobject | null
  • 400The request is malformed or fails validation.

    application/json · ApiError

  • 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 -X POST "$ENGINE_URL/api/transforms/preview" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "input": {},
  "operations": [
    {}
  ]
}'

Make or find the checklist's practice workflow

post/api/users/me/onboarding/practice

The first-run checklist's practice workflow, Demo ADT intake: disabled and synthetic (Demo Health, no PHI). An MLLP trigger with a source filter for ADT A01, A04 and A08, a map to FHIR Patient and Encounter, and one destination, a JavaScript Writer that only answers, so nothing is delivered; its saved sample is a bundled synthetic ADT^A01. Made once per workspace, under an id derived from the workspace (the destination's JavaScript Writer profile too, in the same transaction): 201 when this call made it, audited as workflow.created with source: practice (and adapter_profile.created when it made the profile); 200 with the same id after that. No body. Rate limited to 20 requests per minute.

Minimum role: operator.

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

Responses

  • 200The workspace already has it.
    Response fields

    application/json · object

    • idstring
    • createdboolean

      Always false here.

  • 201Made by this call.
    Response fields

    application/json · object

    • idstring
    • createdboolean

      Always true here.

  • 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

  • 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/users/me/onboarding/practice" \
  -H "Authorization: Bearer $TOKEN"

First-run checklist

get/api/users/me/onboarding

The caller's first-run checklist on the Workflows list, in the caller's workspace: five steps in order (tunnel, sample, build, test, deploy). tunnel: a ready tunnel. sample: a workflow other than the practice workflow with a saved sample message (counted by presence only), or the mark. build: the mark (the practice workflow opened from the card). test: the mark (a test run of the practice workflow sets it), or a stored run of it. deploy: a deployed workflow. Marks are stored per person and workspace. No message content. Rate limited to 60 requests per minute.

Minimum role: viewer.

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

Responses

  • 200The checklist.
    Response fields

    application/json · object

    • dismissedboolean

      The person hid the card (Help reopens it).

    • doneinteger

      Steps done.

    • totalinteger

      Always 5.

    • stepsarray of object
      2 fields
      • idstring

        One of: "tunnel", "sample", "build", "test", "deploy"

      • doneboolean
    • practiceWorkflowIdstring | null

      The practice workflow Demo ADT intake the card opens; null until someone made it (POST /api/users/me/onboarding/practice).

    • tunnelobject | null

      The oldest ready tunnel, or null.

      2 fields
      • namestring
      • peerIpstring
  • 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

  • 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/users/me/onboarding" \
  -H "Authorization: Bearer $TOKEN"

Hide, reopen or mark the first-run checklist

put/api/users/me/onboarding

The caller's first-run checklist on the Workflows list, in the caller's workspace: five steps in order (tunnel, sample, build, test, deploy). tunnel: a ready tunnel. sample: a workflow other than the practice workflow with a saved sample message (counted by presence only), or the mark. build: the mark (the practice workflow opened from the card). test: the mark (a test run of the practice workflow sets it), or a stored run of it. deploy: a deployed workflow. Marks are stored per person and workspace. No message content. dismissed hides or reopens the card; mark records a step taken from it. Audited as onboarding.updated. Rate limited to 60 requests per minute.

Minimum role: operator.

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

Request body (required)

application/json · object

  • dismissedboolean
  • markstring

    One of: "sample", "build", "test"

Responses

  • 200The checklist after the change.
    Response fields

    application/json · object

    • dismissedboolean

      The person hid the card (Help reopens it).

    • doneinteger

      Steps done.

    • totalinteger

      Always 5.

    • stepsarray of object
      2 fields
      • idstring

        One of: "tunnel", "sample", "build", "test", "deploy"

      • doneboolean
    • practiceWorkflowIdstring | null

      The practice workflow Demo ADT intake the card opens; null until someone made it (POST /api/users/me/onboarding/practice).

    • tunnelobject | null

      The oldest ready tunnel, or null.

      2 fields
      • namestring
      • peerIpstring
  • 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

  • 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 PUT "$ENGINE_URL/api/users/me/onboarding" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "dismissed": true,
  "mark": "sample"
}'

Read an API description (New workflow)

post/api/specs/import

Send exactly one of source, doc or url. doc is always read as the document's text and url always fetched; source is told apart: an OpenAPI 3.x or Swagger 2.0 document (JSON or YAML), a Postman collection (v2.x), a curl command, or an https URL of an OpenAPI document (an http URL is a 400). A URL is fetched with every redirect followed only after its hop is checked against private and internal addresses (10 s; a body over 5,242,880 bytes, by Content-Length or as it streams, is a 400 and the rest is not read; a failed fetch is 502 FETCH_FAILED). Only local $ref values are read; a remote one is a 400. Nothing is stored. Audited as api_spec.imported with the format, the endpoint count and whether it came from a URL. Rate limited to 30 requests per minute.

Minimum role: operator.

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

Request body (required)

application/json · object | object | object

Responses

  • 200What the wizard shows.
    Response fields

    application/json · object

    • formatstringrequired

      One of: "openapi-3", "swagger-2", "postman", "curl"

    • titlestringrequired

      The document's title (a curl command: its host).

    • endpointsarray of objectrequired

      At most 50, in document order.

      2 fields
      • methodstring
      • pathstring
    • totalintegerrequired

      Every endpoint in the document.

    • authstringrequired

      One label: OAuth2 client credentials, OAuth2 authorization code, OAuth2, OpenID Connect, API key, Bearer token, Basic auth or No auth.

  • 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

  • 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

  • 502Error.

    application/json · ApiError

Example request

curl
curl -X POST "$ENGINE_URL/api/specs/import" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "source": "string"
}'

Mint a capture URL (New workflow)

post/api/capture

A one-time URL to point a sender at; its first request becomes the wizard's sample. secret is what the sender may sign with (HMAC-SHA256 hex in X-Hub-Signature-256 or X-Webhook-Signature, or Standard Webhooks); it is returned once and not audited. The capture URL expires after 15 minutes; a request it received is kept for 15 minutes from its arrival, then dropped. Audited as capture.created. Rate limited to 20 requests per minute.

Minimum role: operator.

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

Request body

application/json · object

Responses

  • 200The capture.
    Response fields

    application/json · object

    • idstringrequired

      c- and 32 hex characters.

    • urlstringrequired

      Where the sender posts: /api/capture-intake/{id}.

    • secretstringrequired

      HMAC secret for signing the request.

    • expiresAtstring (date-time)required
  • 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

  • 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/capture" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

Wait for the captured request (SSE)

get/api/capture/{id}/stream

Server-sent events: {"type":"waiting"} until the request arrives, then {"type":"captured","request":{method,path,bytes,contentType,hmacValid,body,receivedAt,masked,captureId}} and the stream closes; {"type":"expired"} if the capture runs out first. hmacValid is true (signed with the capture's secret), false (a bad signature) or null (unsigned). No header is pushed (a custom header or a referer can carry PHI); credential and signature headers are not kept at all. body is masked (masked: true): names, identifiers, birth dates and contact details in JSON, HL7 per field, any other text not shown; the raw body stays in Redis for 15 minutes from its arrival and is saved as a draft's sample with PUT /api/workflows/{id}/sample { captureId }. Only the person who minted the capture, in its workspace, can open it (404 otherwise). Delivering the request is audited as capture.read.

Minimum role: operator.

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

Parameters

NameInTypeDescription
idrequiredpathstring

The capture id.

Responses

  • 200An event stream.

    text/event-stream · string

  • 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

Example request

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

Send the request to capture

post/api/capture-intake/{id}

Where the sender posts, once. No engine credential: the unguessable, expiring capture id is the credential. Any body up to 262,144 bytes (413 BODY_TOO_LARGE over); 404 for an unknown or expired capture; 409 ALREADY_CAPTURED after the first request. Audited as capture.received with the size and the HMAC verdict, never the body. Rate limited to 30 requests per minute.

Auth: None, public route · Operation: sendCaptureRequest

Parameters

NameInTypeDescription
idrequiredpathstring

The capture id.

Request body (required)

*/* · string

Responses

  • 200Captured.
    Response fields

    application/json · object

    • capturedboolean
  • 404Not found in the caller's workspace.

    application/json · ApiError

  • 409The request conflicts with the current state.

    application/json · ApiError

  • 413The body is larger than the limit.

    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/capture-intake/<id>" \
  -H "Content-Type: */*" \
  --data-binary @body

Workflow overview

get/api/workflows/{id}/overview

The workflow home's Overview for the last 24 h: key figures (messages, errors, p95 end to end, runs with a retry, this workflow's ACK queue items), 24 hourly buckets with their failures, the steps in run order with their count, p95 and errors, the open issue (failures grouped by the step they failed at, with a suggested next step), the 6 newest runs and the source. Counts and states only: no message content and no error text. The window is cached for 60 s per saved workflow; the newest runs are read live. Rate limited to 120 requests per minute.

Minimum role: viewer.

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

Parameters

NameInTypeDescription
idrequiredpathstring

Workflow id.

Responses

  • 200The overview.
    Response fields

    application/json · object

    • workflowIdstring
    • generatedAtstring (date-time)
    • kpisobject
      5 fields
      • messagesinteger

        Runs in the last 24 h.

      • errorsinteger

        Failed (or partly failed) runs in the last 24 h.

      • p95Msinteger | null

        p95 run time end to end in ms; null when idle.

      • retriesinteger

        Runs where a step needed a retry.

      • ackQueueinteger | null

        This workflow's items in the ACK queue; null when it could not load or its scan cap cut the window short.

    • hourlyarray of object

      24 buckets on clock hours, oldest first; the last is the hour now is in (still filling).

      3 fields
      • startstring (date-time)
      • totalinteger
      • failedinteger
    • stepsarray of object

      In run order, as the builder lists them.

      17 fields
      • idstring

        "trigger" or the node id.

      • nodeIdstring | null
      • numberstring

        The builder's step number, e.g. "1", "3", "5a".

      • kindstring

        e.g. "Trigger", "Filter", "Data map", "Destination".

      • rolestring

        One of: "trigger", "filter", "map", "destination", "source", "step"

      • titlestring

        The step's label.

      • countinteger

        Runs that reached the step in the window.

      • p95Msnumber | null

        p95 step duration in ms; null with no timed result.

      • errorsinteger

        Runs that failed at the step.

      • retriesinteger

        Runs where the step needed a retry.

      • lastStatusstring | null

        The step's newest result; null when idle.

      • branchobject | null

        Destinations only: the router branch the step is on.

        2 fields
        • labelstring

          The router edge's label, e.g. "Admit".

        • everyboolean

          The branch has no filter of its own: every message.

      • queuedboolean

        Destinations only: the send is queued (destination queue).

      • queueDepthinteger | null

        Destinations only: queued deliveries; null when not queued or it could not load.

      • firstStatusinteger | null

        The one retried run's first failing HTTP status (destinations only, when exactly one run retried).

      • finalStatusinteger | null

        That run's final HTTP status.

      • lastFixstring

        When the newest result failed: the ACK queue's next step. Never the error text.

    • openIssueobject | null

      The biggest group of the window's open failures by the step they failed at and their error code; null when none is open. A failure a later retry or replay delivered, or one discarded from the ACK queue, is resolved and left out.

      11 fields
      • nodeIdstring | null
      • stepNumberstring | null
      • stepTitlestring | null
      • countinteger

        Failed runs in the group.

      • firstAtstring (date-time)
      • lastAtstring (date-time)
      • fixstring

        The ACK queue's suggested next step for the newest failure. Never the error text.

      • executionIdstring

        The newest failed run (View runs and Replay in builder).

      • causeobject | null

        A code table miss's structured cause; null for any other failure (fix says what to do).

        6 fields
        • codestring

          One of: "code_table_miss"

        • tablestring

          The code table, from the step's config.

        • fieldstring | null

          The configured field that failed.

        • labelstring

          The field as a name, e.g. "Ward code".

        • keystring | null

          The value that had no entry, read from the failed step's input; null for a PHI path or when it could not be read.

        • sameKeyboolean

          Every failure in the group was read and had this key.

      • fixVersioninteger | null

        The newest undeployed version whose diff against the live one changes the failing step; null when none.

      • cappedboolean

        Present when the failures read hit their cap (500): count is a floor.

        One of: true

    • recentRunsarray of object

      The 6 newest runs, any age.

      8 fields
      • idstring
      • startedAtstring (date-time)
      • statusstring
      • controlIdstring | null

        MSH-10 or the X12 control number.

      • typestring | null

        e.g. "ADT^A08".

      • msinteger | null

        Run time in ms; null while it runs.

      • retriedboolean

        A step needed a retry.

      • filteredboolean

        Completed without reaching a destination.

    • sourceobject
      6 fields
      • typestring

        The trigger type.

      • titlestring

        e.g. "MLLP listener".

      • subtitlestring

        e.g. ":2575 via demo-adt".

      • listeningboolean | null

        Whether a listening trigger is on; null for a trigger that does not wait for messages.

      • lastMessageAtstring (date-time) | null
      • tunnelobject | null
        3 fields
        • namestring
        • upboolean | null
        • upSincestring (date-time) | null

          Up since (the tunnel watcher); null when unknown.

  • 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

  • 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/workflows/<id>/overview" \
  -H "Authorization: Bearer $TOKEN"

Workflow runs

get/api/workflows/{id}/runs

The workflow home's Runs tab: the workflow's runs over the last 24 h, newest first, with the chip counts (all, failed, retried, filtered; cached for 60 s). result narrows the rows. q matches a run id prefix, the message control id or, for callers who may see PHI, the MRN, through the message-search lookup columns; a search is audited as message.searched with the field searched, never the value. Rows carry no message content and no error text. Rate limited to 120 requests per minute.

Minimum role: viewer.

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

Parameters

NameInTypeDescription
idrequiredpathstring

Workflow id.

resultquerystring

all (default), failed, retried or filtered.

qquerystring

Run id prefix, message control id or MRN (1-100 characters).

cursorquerystring

nextCursor from the previous page.

limitqueryinteger

1-100, default 50.

Responses

  • 200A page of runs.
    Response fields

    application/json · object

    • workflowIdstring
    • windowHoursinteger

      The window the rows and counts cover (24).

    • countsobject | null

      The chip counts over the window, cached for 60 s; null when they could not load.

      4 fields
      • allinteger
      • failedinteger

        Failed or partly failed runs.

      • retriedinteger

        Runs where a step needed a retry.

      • filteredinteger

        Completed runs that reached no destination.

    • runsarray of object

      Newest first.

      8 fields
      • idstring
      • startedAtstring (date-time)
      • controlIdstring | null

        MSH-10 or the X12 control number.

      • typestring | null

        e.g. "ADT^A08".

      • eventstring | null

        The trigger event, e.g. "A08".

      • routearray of string

        The destinations the run delivered to, in step order.

      • resultobject
        2 fields
        • kindstring

          One of: "ok", "retry", "err", "skip", "live", "off"

        • labelstring

          e.g. "Delivered · Epic 201, GCS" (each destination reached, with its final HTTP status where it has one), "Delivered on retry 2 · Epic 503 first", "Failed at 3 · no entry for 5E" (a code table miss's key; "no code-table entry" at a PHI path), "Failed at 3 · Location → facility", "Filtered · A03 not routed", "Running".

      • msinteger | null

        Run time in ms; null while it runs.

    • nextCursorstring | null

      Pass as cursor for the next page.

  • 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

  • 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/workflows/<id>/runs" \
  -H "Authorization: Bearer $TOKEN"

Workflow run detail

get/api/workflows/{id}/runs/{runId}

One run of the workflow for the Runs side panel: the row, the trace, the failed step with a suggested next step (never the error text), the message as received with its PHI masked (no raw PHI; viewers get none), the ACK, the version and engine it ran on, and calledBy (the run that called this one through a Call workflow step and its workflow, ids only so viewers get it too; null when nothing called it or the caller is gone). 404 for a run of another workflow or workspace. Audited as execution.viewed. With phi=reveal and a reason, an operator or admin also gets the message unmasked as message.revealed; the request is audited instead as one phi.revealed event on the execution (the reason and a keyed hash of each patient id in PID-3 and MRG-1, at most 200 with the rest counted as patientsOmitted, never a value; none for a body that isn't HL7 v2; revealed: false for a run with no recorded message), written before anything is returned (500 PHI_REVEAL_NOT_RECORDED and no message when it can't be, as on Messages). A bad phi or reason is a 400 and a viewer's reveal a 403 (PHI_REVEAL_FORBIDDEN). Rate limited to 120 requests per minute.

Minimum role: viewer.

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

Parameters

NameInTypeDescription
idrequiredpathstring

Workflow id.

runIdrequiredpathstring

Execution id.

phiquerystring

reveal to show the message unmasked (audited).

reasonquerystring

Why PHI is shown; required with phi=reveal.

Responses

  • 200The run.
    Response fields

    application/json · object

    • idstring
    • startedAtstring (date-time)
    • controlIdstring | null

      MSH-10 or the X12 control number.

    • typestring | null

      e.g. "ADT^A08".

    • eventstring | null

      The trigger event, e.g. "A08".

    • routearray of string

      The destinations the run delivered to, in step order.

    • resultobject
      2 fields
      • kindstring

        One of: "ok", "retry", "err", "skip", "live", "off"

      • labelstring

        e.g. "Delivered · Epic 201, GCS" (each destination reached, with its final HTTP status where it has one), "Delivered on retry 2 · Epic 503 first", "Failed at 3 · no entry for 5E" (a code table miss's key; "no code-table entry" at a PHI path), "Failed at 3 · Location → facility", "Filtered · A03 not routed", "Running".

    • msinteger | null

      Run time in ms; null while it runs.

    • workflowIdstring
    • statusstring
    • tracearray of object

      The trigger, then each step in the order it ran, then (after a failure) the next steps that never ran.

      6 fields
      • nstring

        The builder's step number, e.g. "1", "3", "5a".

      • titlestring
      • statusstring

        One of: "ok", "err", "retry", "skip", "no", "live"

      • offsetMsinteger

        When the step started, in ms after the run started.

      • msinteger | null

        How long it took; null when it never ran.

      • retriesinteger
    • failureobject | null
      5 fields
      • stepNumberstring | null
      • stepTitlestring | null
      • fixstring

        The ACK queue's suggested next step. Never the error text.

      • causeobject | null

        A code table miss: the table and field from the step's config, never from the error text.

        4 fields
        • codestring

          One of: "code_table_miss"

        • tablestring

          The code table the step looks up.

        • labelstring

          The field that failed, in words, e.g. "Ward code".

        • keystring | null

          The value looked up, read from the failed step's input; null at a PHI path (never read) or when it could not be read.

      • nackstring | null

        The NACK the sender got (MLLP trigger answering once the run settles); null when none was sent.

        One of: "AE", "AR"

    • messageobject
      3 fields
      • maskedstring | nullrequired

        The HL7 v2 message as received with its patient fields masked; null for viewers, for a run without a message and for a body that is not HL7 v2.

      • reasonstring

        One of: "viewer", "not-hl7", "none"

      • revealedstring

        The message as received, unmasked. Only on an audited phi=reveal request, and only when a message was recorded (an HL7 v2 body or one that is not HL7 v2).

    • ackstring | null

      The HL7 ACK the sender got: "AA" (always in accept mode), or e.g. "AE · step 3 failed"; null while it runs or when the message did not come in over MLLP.

    • ranOnobject
      2 fields
      • versioninteger | null

        The version live when the run started.

      • enginestring | null

        The engine instance that ran it.

    • calledByobject | null
      2 fields
      • executionIdstring

        The run whose Call workflow step started this one.

      • workflowIdstring

        That run's workflow (its Runs tab opens it).

    • queueMsinteger | null

      Received to started in ms: how long the run waited to be picked up (the old execution page's Queue Time). Null while pending, for a run cancelled before a claim, or for rows written before the received time was kept.

  • 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

  • 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/workflows/<id>/runs/<runId>" \
  -H "Authorization: Bearer $TOKEN"

A step's errors in the last 24 hours

get/api/workflows/{id}/step-errors

The step editor's Errors · last 24 h: the step's failures in failed runs of the workflow from the last 24 hours, newest first, at most 20 (the 200 newest failed runs are looked at). Error text can quote the message, so a viewer gets [redacted] in its place; the times, execution ids, control ids and message types stay. Everyone else gets it masked by default (phiMasked: true; names, ids, dates and message values as •••, field paths and codes kept): the masked read is not audited. With phi=reveal&reason= the text is served as it is, after phi.revealed is written (the reason, part: "step-errors", the step, the failed runs' patient keys, never a value); a reveal that can't be recorded serves nothing (500 PHI_REVEAL_NOT_RECORDED), a bad reason is a 400 and a viewer's reveal a 403 PHI_REVEAL_FORBIDDEN.

Minimum role: viewer.

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

Parameters

NameInTypeDescription
idrequiredpathstring

Workflow id.

nodeIdrequiredquerystring

The step's node id (letters, digits, _ . : -; up to 200).

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

  • 200The step's recent errors.
    Response fields

    application/json · object

    • windowHoursinteger

      Always 24.

    • phiMaskedboolean

      True when the errors are masked.

    • errorsarray of object
      5 fields
      • executionIdstring

        The failed run (Use as input, Replay).

      • atstring (date-time)

        When the step failed.

      • errorstring

        The step's error, or [redacted] for a viewer.

      • messageIdstring | null

        The message control id (MSH-10), or null on a sealed row.

      • messageTypestring | null

        The message type (MSH-9), or 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

  • 500Unexpected server error.

    application/json · ApiError

Example request

curl
curl "$ENGINE_URL/api/workflows/<id>/step-errors?nodeId=string" \
  -H "Authorization: Bearer $TOKEN"

The last real input at a step

get/api/workflows/{id}/step-recent-input

The step editor's Recent · PHI: the newest message run of the workflow that reached the step, and the input that step recorded, as path → value fields. Values are masked by default; the message header and event stay readable. Every read is audited as message.viewed (ids only). phi=reveal with a reason returns the values unmasked after a phi.revealed event (reason only) is recorded; if it can't be recorded, nothing is revealed (500). Viewers get no values (redacted: true) and a reveal answers 403. Only the workflow's 200 newest runs of any kind are looked at, manual and test runs included, so a workflow mostly run by hand can answer recent: null although a real message reached the step further back.

Minimum role: viewer.

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

Parameters

NameInTypeDescription
idrequiredpathstring

Workflow id.

nodeIdrequiredquerystring

The step's node id (letters, digits, _ . : -; up to 200).

phiquerystring

reveal to return the values unmasked (audited).

reasonquerystring

Why PHI is shown; required with phi=reveal.

Responses

  • 200The step's last input, or null when no message reached it.
    Response fields

    application/json · object

    • recentobject | null
      7 fields
      • executionIdstring

        The run (what Run step runs).

      • atstring (date-time)

        When the run started.

      • typestring | null

        The message type (MSH-9), or null.

      • controlIdstring | null

        The message control id, or null on a sealed row.

      • inputmap of string

        Path → value; masked unless revealed, empty for a viewer.

      • maskedboolean

        The values are masked.

      • redactedboolean

        A viewer: no values.

  • 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

  • 500Unexpected server error.

    application/json · ApiError

Example request

curl
curl "$ENGINE_URL/api/workflows/<id>/step-recent-input?nodeId=string" \
  -H "Authorization: Bearer $TOKEN"

A workflow's newest runs, for the builder's Input picker

get/api/workflows/{id}/recent-runs

The builder Input picker's Recent messages and Executions: the workflow's newest runs, newest first (6 by default, at most 20), each with its time, status, message type, control id (null on a sealed row) and, for a failed run, the step that failed. No message content, so the read is not audited and viewers get the same rows. Running one as a test input is audited by test-steps (message.viewed); its recorded trace comes from GET /api/executions/{id} (execution.viewed).

Minimum role: viewer.

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

Parameters

NameInTypeDescription
idrequiredpathstring

Workflow id.

limitqueryinteger

How many runs (1-20, default 6).

Responses

  • 200The workflow's newest runs.
    Response fields

    application/json · object

    • runsarray of object
      6 fields
      • idstring

        The execution id (Use as input, Replay).

      • atstring (date-time)

        When the run started.

      • statusstring

        pending, running, completed, failed, …

      • typestring | null

        The message type (MSH-9), or null.

      • controlIdstring | null

        The message control id (MSH-10), or null.

      • failedNodeIdstring | null

        The step a failed run stopped at, or 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

  • 500Unexpected server error.

    application/json · ApiError

Example request

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

Per-step traffic over the last 24 hours

get/api/workflows/{id}/node-stats

The Graph canvas's Live · 24 h overlay: for each step, how many runs of the workflow went through it in the last 24 hours, how many of them failed there, and its p95 time in ms. At most the 20,000 newest runs in the window are looked at (capped says when there were more). Counts and times only, no message content, so the read is not audited and viewers get the same answer. Cached for 60 s.

Minimum role: viewer.

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

Parameters

NameInTypeDescription
idrequiredpathstring

Workflow id.

windowquerystring

The window; only 24h (the default).

Responses

  • 200Each step's traffic in the window.
    Response fields

    application/json · object

    • windowstring

      Always 24h.

    • sincestring (date-time)

      The window's start.

    • runsinteger

      Runs looked at in the window.

    • cappedboolean

      The window held more runs than were looked at.

    • nodesarray of object
      4 fields
      • nodeIdstring

        The step's node id.

      • countinteger

        Runs that went through the step.

      • errorsinteger

        Of those, runs where the step failed.

      • p95Msnumber | null

        The step's p95 time in ms, or 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

  • 500Unexpected server error.

    application/json · ApiError

Example request

curl
curl "$ENGINE_URL/api/workflows/<id>/node-stats" \
  -H "Authorization: Bearer $TOKEN"

The workflow's environment

get/api/workflows/{id}/environment

The deploy target: each connection the workflow's steps use calls this environment's URL and credentials. Lists those connections with the environments each has. Rate limited to 60 requests per minute.

Minimum role: viewer.

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

Parameters

NameInTypeDescription
idrequiredpathstring

Workflow id.

Responses

  • 200The environment.
    Response fields

    application/json · object

    • environmentstring

      One of: "production", "sandbox"

    • connectionsarray of object

      The connections the workflow's steps use.

      3 fields
      • idstring
      • namestring
      • environmentsarray of string
  • 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/workflows/<id>/environment" \
  -H "Authorization: Bearer $TOKEN"

Set the workflow's environment

put/api/workflows/{id}/environment

Switches the deploy target from the next run on. 409, with missing (connection names), while a connection the workflow uses has no such environment: a run never falls back to the other one. Audited as workflow.environment_changed. Rate limited to 20 requests per minute.

Minimum role: operator.

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

Parameters

NameInTypeDescription
idrequiredpathstring

Workflow id.

Request body (required)

application/json · object

  • environmentstringrequired

    One of: "production", "sandbox"

Responses

  • 200The environment after the change.
    Response fields

    application/json · object

    • environmentstring

      One of: "production", "sandbox"

    • connectionsarray of object

      The connections the workflow's steps use.

      3 fields
      • idstring
      • namestring
      • environmentsarray of string
  • 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 PUT "$ENGINE_URL/api/workflows/<id>/environment" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "environment": "production"
}'

A draft's MLLP listener

get/api/workflows/{id}/listener

The listener a never-deployed workflow opened, with how many messages it holds for the first deploy (counted only while one is open); listener is null when none is. With tunnelId, tunnel names that tunnel and its sender (what the builder's confirm shows). A read: not audited.

Minimum role: viewer.

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

Parameters

NameInTypeDescription
idrequiredpathstring

The draft workflow's id.

tunnelIdquerystring

A tunnel to name, for the confirm.

Responses

  • 200The listener (or null) and the tunnel (or null).
    Response fields

    application/json · object

    • listenerobject | nullrequired
      9 fields
      • workflowIdstringrequired

        The draft.

      • portintegerrequired

        The MLLP port it listens on.

      • listenerstringrequired

        The Helm-declared listener on that port (mllp.listeners).

      • tunnelIdstring | nullrequired

        The tunnel the sender delivers through.

      • tunnelNamestring | nullrequired

        The tunnel's name.

      • senderstring | nullrequired

        Who delivers: the tunnel's healthcare organization, else its name.

      • openedBystring | nullrequired

        Who opened it.

      • openedAtstring (date-time)required

        When, ISO 8601.

      • heldintegerrequired

        Messages held for the first deploy.

    • tunnelobject | nullrequired
      3 fields
      • idstringrequired
      • namestringrequired
      • senderstringrequired

        The tunnel's healthcare organization, else its name.

  • 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

  • 500Unexpected server error.

    application/json · ApiError

Example request

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

Open an MLLP listener for a draft

post/api/workflows/{id}/listener

Routes the Helm-declared MLLP listener on port to a workflow that was never deployed. From then on what arrives on that port and passes the draft's trigger (message types, filter) is answered AA and held: stored with status held_for_deploy, not run, nothing delivered. The first deploy (POST /api/workflows/{id}/deploy) runs the held messages on the deployed version, each sender's in arrival order, and closes this listener. Deleting the draft first keeps them with status filtered and the error "draft deleted before deploy". The engine opens no socket itself: a port Helm does not declare is a 422. 409 when the workflow is deployed, or another workflow's trigger or another draft already uses the port; 404 for a workflow or tunnel outside the workspace. Operators and admins (a viewer gets 403). Audited as listener.opened with approvedBy, port, tunnelId, listener and proposal; an Agent approval card's proposal is resolved done (GET /api/ai/proposals/{id}). Rate limited to 10 requests per minute.

Minimum role: operator.

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

Parameters

NameInTypeDescription
idrequiredpathstring

The draft workflow's id.

Request body (required)

application/json · object

  • portintegerrequired

    The MLLP port.

  • tunnelIdstringrequired

    The tunnel the sender delivers through.

  • proposalstring

    The Agent card this was opened from.

Responses

  • 201Open.
    Response fields

    application/json · object

    • listenerobject
      9 fields
      • workflowIdstringrequired

        The draft.

      • portintegerrequired

        The MLLP port it listens on.

      • listenerstringrequired

        The Helm-declared listener on that port (mllp.listeners).

      • tunnelIdstring | nullrequired

        The tunnel the sender delivers through.

      • tunnelNamestring | nullrequired

        The tunnel's name.

      • senderstring | nullrequired

        Who delivers: the tunnel's healthcare organization, else its name.

      • openedBystring | nullrequired

        Who opened it.

      • openedAtstring (date-time)required

        When, ISO 8601.

      • heldintegerrequired

        Messages held for the first deploy.

  • 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

  • 422The request is well formed but cannot be processed.

    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/workflows/<id>/listener" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "port": 1,
  "tunnelId": "string",
  "proposal": "string"
}'

Close a draft's MLLP listener

delete/api/workflows/{id}/listener

Stops routing the port to the draft. Messages it already holds stay held until the first deploy runs them. 404 when none is open. Operators and admins. Audited as listener.closed. Rate limited to 10 requests per minute.

Minimum role: operator.

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

Parameters

NameInTypeDescription
idrequiredpathstring

The draft workflow's id.

Responses

  • 200Closed.
    Response fields

    application/json · object

    • closedboolean
  • 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

  • 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 DELETE "$ENGINE_URL/api/workflows/<id>/listener" \
  -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.

DryRunResult

  • matchedbooleanrequired

    False when the trigger's matching rules rejected the message.

  • reasonstring

    Why it did not match.

  • statusstring

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

  • errorstring | null
  • stepsarray of objectrequired
    6 fields
    • nodeIdstring
    • nodeNamestring
    • statusstring

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

    • errorstring | null
    • durationMsinteger | null
    • dataany | null

      The step's output.

ErrorHandling

What a failed step does. Step retries wait in-process within one run, so each wait is capped at 60 s and the attempts at 10; longer waits are workflow retries (maxWorkflowRetries), which are durable.

  • strategystringrequired

    One of: "retry", "skip", "fail"

  • maxRetriesinteger
  • retryDelaynumber

    Milliseconds before the first step retry.

  • backoffMultipliernumber

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).

FieldMapping

  • sourcestringrequired

    JSON path ("$.name[0].family"; "[*]" reads every array item) or "hl7:" + an HL7 path ("hl7:PID.5.1", "hl7:OBX[*].5", "hl7:PID.3(2).1").

  • sourcesarray of string

    Concatenate: source then each of these (one value each, no [*]); empty parts are skipped.

  • separatorstring

    Joins sources (default " ").

  • targetstringrequired

    Target path. "hl7:PID.5.1" edits the HL7 text and needs config.mapMode "copy" on an HL7 input. In an hl7v2-to-fhir step (merge mode) the target names a resource: "Patient.name[0].family" or "Bundle.meta.tag[0].code".

  • transformstring

    Legacy single transform, run before ops. "date" is HL7 DT/DTM to ISO 8601 (shape and offset kept); other text is read by JavaScript Date and written as a UTC ISO timestamp (text with no offset is read in the engine's time zone), as before value ops. A stored "custom" (a no-op) is dropped.

    One of: "uppercase", "lowercase", "trim", "date"

  • opsarray of ValueOp

    Value ops, in order, after the inline lookup and default. An op that cannot read its value is a row error (config.onRowError).

  • defaultstring

    Used when the source is missing or empty.

  • lookupValuesarray of object

    Inline quick lookup: an unknown value gets default when set, else passes through.

    3 fields
    • fromstringrequired
    • tostringrequired
    • notestring
  • lookupstring

    Code table name (applied last).

  • onMissingCodestring

    A value the lookup code table lacks: a row error (default), kept, or default (required with "default"). A missing table always fails.

    One of: "fail", "passthrough", "default"

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

TransformStepConfig

Options of a transform step (checked at save). Other keys are type-specific (fhir-to-hl7v2, fhir-bulk-split).

  • mapModestring

    field-mapping: build a new object, or copy the input and set only the targets ("copy"; hl7: targets edit an HL7 input in place).

    One of: "new", "copy"

  • onRowErrorstring

    A mapping row that cannot be applied fails the step (rejected: not retried automatically) or drops its field with a warning in the node result's diagnostics.

    One of: "fail", "skip"

  • mappingModestring

    hl7v2-to-fhir: custom mappings write into the converter's Bundle (merge) or replace the converter (replace).

    One of: "merge", "replace"

  • nextOfKinstring

    hl7v2-to-fhir: each NK1 as a RelatedPerson linked to the Patient, or left out.

    One of: "skip", "related-person"

  • messageHeaderstring

    hl7v2-to-fhir: a MessageHeader from MSH whose focus is every other resource, or left out.

    One of: "skip", "include"

  • fieldsarray of string

    code-table: the JSON paths to translate ([*] allowed); an unknown code fails unless onMissingCode says otherwise. Without fields every string is translated and unknown codes pass through.

  • onMissingCodestring

    code-table: an unknown code (with default for "default").

    One of: "fail", "passthrough", "default"

  • codeTablesarray of string

    javascript: code tables lookup(table, code) may read, loaded before the code runs.

  • escapestring

    template: how {{values}} are escaped. Default from the text after any leading {{#…}}/{{/…}}/{{else}} tags: json for {…}/[…], hl7 for MSH… (escapes | and line breaks, keeps ^ ~ &), xml for <…, else none.

    One of: "none", "json", "hl7", "xml"

  • onMissingstring

    template: a path with no value renders empty (JSON: null) with a warning, or fails the step.

    One of: "empty", "fail"

  • delimiterstring

    csv-parse / csv-generate: one character; "\t" for a tab.

  • recordDelimiterstring

    csv-parse: "auto" (CRLF, LF or CR) or a literal record separator.

  • quotestring

    csv-parse / csv-generate: the quote character.

  • headerboolean

    csv-parse: the first record names the columns (false: col1..colN or columns). csv-generate: write a header line.

  • columnsarray of any

    csv-parse: [{ name, type: string|number|boolean|date }]. csv-generate: the column order (names).

  • maxRowsinteger

    csv-parse: more rows than this fails the step.

  • quoteModestring

    csv-generate: quote only fields that need it, or every field.

    One of: "minimal", "all"

  • xpathsmap of string

    xml-parse: names to XPath expressions (a subset: paths, //, *, @attr, text(), count(), [n], [last()], [@a='v'], [child='v']); results in values.

  • stripNamespacesboolean

    xml-parse: drop namespace prefixes from element and attribute names.

  • stylesheetstring

    xslt: the XSLT 1.0 stylesheet. Self-contained: xsl:include, xsl:import and document() other than document('') are refused, and so is a DOCTYPE or entity declaration.

  • sourcestring

    xslt: what the stylesheet reads: the message text, the text at sourceField, the channel map's sourceVariable, or (hl7-xml) the HL7 v2 message as Mirth's HL7 v2 XML; then output to the message that is <HL7Message> XML becomes HL7 v2 again.

    One of: "message", "field", "variable", "hl7-xml"

  • sourceFieldstring

    xslt: a dot path when source is "field".

  • sourceVariablestring

    xslt: a channel map name when source is "variable".

  • resultTostring

    xslt: where the output goes: it becomes the message (a file pickup keeps its details, with the output as content), resultField on a copy of the message, or the channel map's resultVariable (the message goes on unchanged).

    One of: "message", "field", "variable"

  • resultFieldstring

    xslt: a dot path when resultTo is "field".

  • resultVariablestring

    xslt: a channel map name when resultTo is "variable".

  • paramsarray of object

    xslt: global xsl:param values. A value is text; {{channel.KEY}} reads the channel map and {{sender.KEY}} the run's sender settings.

    2 fields
    • namestringrequired
    • valuestringrequired

ValueOp

uppercase, lowercase, trim; substring {start, end?}; pad {length ≤ 255, char, side left|right}; replace {find, with} (literal, every occurrence; no regex); date-format {from (auto|ISO|ISO-DATE|HL7|HL7DT|YYYYMMDD|YYYY-MM-DD|MM/DD/YYYY), to, timezone? (IANA)}; type-cast {to number|boolean|string, trueValues?, falseValues?}.

  • opstringrequired

    One of: "uppercase", "lowercase", "trim", "substring", "pad", "replace", "date-format", "type-cast"

Workflow

  • idstringrequired
  • namestringrequired
  • descriptionstring
  • enabledbooleanrequired
  • nodesarray of WorkflowNoderequired
  • edgesarray of WorkflowEdgerequired
  • startNodeIdstringrequired
  • triggerobject | object | object | object | object | object | object | object | object | object | object | object | objectrequired

    One of eight supported trigger types. The type discriminant selects the applicable additional fields.

    13 fields
    • type: "manual"object
      1 field
      • typestringrequired

        One of: "manual"

    • type: "topic"object

      Runs once for every event a Publish step writes to the topic (same workspace). Durable fan-out through the work table, at least once, deduplicated by event id.

      2 fields
      • typestringrequired

        One of: "topic"

      • topicstringrequired
    • type: "webhook"object
      13 fields
      • typestringrequired

        One of: "webhook"

      • webhookIdstringrequired
      • pathstring
      • splitBatchesboolean

        Split an HL7 v2 batch (FHS/BHS ... BTS/FTS, or several MSH segments in one delivery) into one run per message, in batch order, each deduplicated on its own MSH-10.

      • charsetstring

        How the received bytes are decoded before parsing. Omitted: UTF-8 (or the Content-Type charset parameter). msh-18: the message's MSH-18 (8859/1, UNICODE UTF-8, ASCII), UTF-8 when it is empty or unknown.

        One of: "utf-8", "iso-8859-1", "windows-1252", "ascii", "msh-18"

      • secretstring
      • timestampToleranceSecondsinteger

        Replay window: the most seconds a signed timestamp (webhook-timestamp or x-webhook-timestamp) may be from the engine's clock. Outside it the answer is 401 TIMESTAMP_OUT_OF_TOLERANCE.

      • requireTimestampboolean

        Refuse a valid signature that carries no signed timestamp (401 TIMESTAMP_REQUIRED). Off: senders that sign the body only keep working.

      • expectedHeadersmap of string
      • bodySchemaobject

        JSON Schema the body must match: type, properties, required, additionalProperties (boolean), items, enum, const, minLength, maxLength, pattern, format (date, date-time, email, uuid), minimum, maximum, minItems, maxItems; $schema, title and description are allowed and not checked; $defs at the root and $ref to #/$defs/<name>. Other keywords are refused on save. A pasted OpenAPI requestBody (with its components) or document ({ document, operationId }) is stored converted to this subset. A body that no trigger on the webhook id accepts is 400 BODY_SCHEMA_INVALID with problems (JSON Pointers, never values), and nothing runs.

      • senderFromobject

        Where a JSON delivery names its sender, for the workflow's sender table ({{sender.KEY}}, per-sender connections): exactly one of path (a dotted path into the body, e.g. organization.id) or header (a header name). The value is matched like an HL7 message's MSH-4.

        2 fields
        • pathstring
        • headerstring
      • orderingstring

        fifo: deliveries run one at a time in arrival order, across every engine replica (an ordering lane per trigger). none: they run in parallel.

        One of: "none", "fifo"

      • onErrorstring

        With ordering fifo. continue: a failed message is reported and the next one runs. hold: a failed message stops its lane; only its own retries and replays run until one succeeds, or the message is discarded from the ACK queue.

        One of: "continue", "hold"

    • type: "schedule"object
      3 fields
      • typestringrequired

        One of: "schedule"

      • cronstringrequired

        Cron expression; an alias of the cron trigger, run once per slot across replicas.

      • timezonestring
    • type: "cron"object
      3 fields
      • typestringrequired

        One of: "cron"

      • cronExpressionstringrequired
      • timezonestring
    • type: "polling"object
      12 fields
      • typestringrequired

        One of: "polling"

      • intervalintegerrequired

        Poll interval in milliseconds (at least 10000).

      • adapterProfileIdstringrequired

        Adapter profile to read; must be in the workflow's workspace.

      • actionstring

        Adapter action to call. Default: search when the adapter has it (FHIR adapters, whose read is read-by-id), otherwise read.

      • paramsobject

        Adapter params. A string value containing {{cursor}} gets the stored cursor; before the first cursor such a value is left out.

      • itemsPathstring

        Dot path to the item array in the adapter result. Not needed for an array or a FHIR Bundle.

      • idFieldstring

        Dot path to each item's id. With cursorField, the dedup key is the id plus its cursor value, so a later change to the same record runs again.

      • cursorFieldstring

        Dot path to an ordered change marker (ISO timestamp or number). Without it, the last 5,000 ids seen are the replay guard.

      • cursorFormatstring

        How cursorField values are written when they do not sort as text (MM/DD/YYYY). Each value is read in this format and stored as ISO-8601; {{cursor}} is sent back in it. A value that does not parse does not run. Changing it starts the cursor again.

        One of: "MM/DD/YYYY", "MM/DD/YYYY HH:mm", "MM/DD/YYYY HH:mm:ss", "MM/DD/YYYY hh:mm A", "MM/DD/YYYY hh:mm:ss A", "DD/MM/YYYY", "DD/MM/YYYY HH:mm:ss", "YYYYMMDDHHmmss", "epoch-seconds", "epoch-millis"

      • maxItemsPerPollinteger

        Items one poll runs. Items sharing the last item's cursor value also run, so a group is never split.

      • filterobject

        Inbound filter ({ logic, rules, groups?, customScript? }), as on the other triggers. A polled item it rejects runs no workflow and creates no work row, but the cursor moves past it, so it is not read again.

      • startFromstring

        now: the first poll records what already exists and runs nothing. beginning: the first poll runs every item.

        One of: "now", "beginning"

    • type: "mllp"object
      13 fields
      • typestringrequired

        One of: "mllp"

      • messageTypesarray of stringrequired
      • sendingFacilitystring
      • sendingAppstring
      • splitBatchesboolean

        Split an HL7 v2 batch (FHS/BHS ... BTS/FTS, or several MSH segments in one delivery) into one run per message, in batch order, each deduplicated on its own MSH-10.

      • charsetstring

        How the received bytes are decoded before parsing. Omitted: UTF-8. msh-18: the message's MSH-18 (8859/1, UNICODE UTF-8, ASCII), UTF-8 when it is empty or unknown.

        One of: "utf-8", "iso-8859-1", "windows-1252", "ascii", "msh-18"

      • listenerstring

        The MLLP listener (port) this trigger takes messages from, declared in Helm mllp.listeners. Omitted: default (mllp.port). A save naming an undeclared listener is a 400.

      • ackModestring

        accept: AA once the message is durably recorded. respond (#751): waits like destination, then answers with the ACK the workflow's Respond step built (a custom MSA and ERR segments, or a whole ACK); with no usable Respond output, the destination-mode outcome; when the wait runs out, ackTimeoutCode. destination: the ACK waits for the workflow's destinations: AA when every one completed, AR when one rejected it for good, AE on any other failure or when they have not finished within ackTimeoutMs. A resend of a message whose delivery failed replays it once and waits again. Not used for messages from an msh15 listener that set MSH-15.

        One of: "accept", "destination", "respond"

      • ackTimeoutMsinteger

        destination and respond modes: how long the ACK waits, capped at the listener's MLLP_TIMEOUT minus 5 s. One sender connection handles one message at a time, so a slow destination slows that sender (intended backpressure).

      • ackTimeoutCodestring

        respond mode: the ACK sent when the run has not settled within ackTimeoutMs. AE: the sender resends (dedup absorbs it). AR: the sender gives up on the message; the recorded run still runs.

        One of: "AE", "AR"

      • ackOnFailurestring

        respond mode, when a step after the Respond step fails: respond keeps the Respond step's ACK (Mirth's respond from destination); AE answers AE "Workflow failed; retry".

        One of: "respond", "AE"

      • filteredAckstring

        The ACK for a message this trigger's filter drops when no other workflow takes it. AR: "No matching triggers". AA: accepted, as Mirth answers for filtered messages. Either way the message is kept in Messages as Filtered, with the rule that dropped it.

        One of: "AR", "AA"

      • onErrorstring

        Messages always run in arrival order per sending facility (lane <trigger>|<MSH-4>). continue: a failed message is reported and the next one runs. hold: a failed message stops its lane; only its own retries and replays run until one succeeds, or the message is discarded from the ACK queue.

        One of: "continue", "hold"

    • type: "fhir-subscription"object
      6 fields
      • typestringrequired

        One of: "fhir-subscription"

      • resourceTypestringrequired
      • criteriastring
      • interactionstring

        One of: "create", "update", "delete", "create-or-update"

      • orderingstring

        fifo: deliveries run one at a time in arrival order, across every engine replica (an ordering lane per trigger; one lane per resourceType/id). none: they run in parallel.

        One of: "none", "fifo"

      • onErrorstring

        With ordering fifo. continue: a failed message is reported and the next one runs. hold: a failed message stops its lane; only its own retries and replays run until one succeeds, or the message is discarded from the ACK queue.

        One of: "continue", "hold"

    • type: "x12"object
      19 fields
      • typestringrequired

        One of: "x12"

      • transactionSetsarray of stringrequired
      • sourceTypestringrequired

        Which deliveries this trigger takes. The server decides a delivery's source: webhook for POST /api/triggers/x12 with a token, upload for a dashboard upload, sftp for the SFTP pickup. A sender cannot claim one.

        One of: "sftp", "webhook", "upload"

      • sftpProfileIdstring

        sourceType sftp: the SFTP adapter profile whose folder the engine polls for X12 files.

      • pollIntervalinteger

        sourceType sftp: milliseconds between pickups.

      • remotePathstring

        sourceType sftp: the folder to pick files up from.

      • filenamePatternstring

        sourceType sftp: a glob (*, ?, [abc]) on the file name.

      • afterProcessingstring

        sourceType sftp: what happens to a file once its transaction sets are recorded. A file is never run twice, leave included: the engine's record of a file does not expire while the file is in the folder, and deduplicate: false does not turn it off.

        One of: "move", "delete", "leave"

      • processedPathstring

        sourceType sftp: where move puts files (required for move).

      • errorPathstring

        sourceType sftp: where a file that is not X12 goes; without it the file stays and the error is recorded.

      • filenameRegexboolean

        filenamePattern is a regular expression matched against the whole name.

      • minFileAgeMsinteger

        A file modified more recently than this may still be being written and waits for a later pickup.

      • maxFileBytesinteger

        A larger file (by its listed size) is never downloaded: it goes to errorPath (or stays) with a size error.

      • sortBystring

        Pickup order: oldest first, or by name.

        One of: "modified", "name"

      • encodingstring

        How file bytes are decoded (latin1: ISO-8859-1).

        One of: "utf8", "latin1"

      • ackPathstring

        sourceType sftp: where the 999 / TA1 (see acknowledgments) are written, as <file>.999 / <file>.ta1.

      • acknowledgmentsstring

        999: a 999 per functional group comes back with the delivery. 999+ta1: also a TA1 when ISA14=1 or the envelope is broken. Syntax checks only (control numbers and counts, a known ST), not implementation-guide validation.

        One of: "none", "999", "999+ta1"

      • orderingstring

        fifo: deliveries run one at a time in arrival order, across every engine replica (an ordering lane per trigger). none: they run in parallel.

        One of: "none", "fifo"

      • onErrorstring

        With ordering fifo. continue: a failed message is reported and the next one runs. hold: a failed message stops its lane; only its own retries and replays run until one succeeds, or the message is discarded from the ACK queue.

        One of: "continue", "hold"

    • type: "sftp"object

      Picks files up from an SFTP folder (like a Mirth File Reader). A file is downloaded only once it is minFileAgeMs old and its listed size is at most maxFileBytes; it is moved, deleted or left only after its runs are recorded, and never runs twice.

      20 fields
      • typestringrequired

        One of: "sftp"

      • sftpProfileIdstringrequired

        The SFTP adapter profile whose folder the engine polls.

      • minFileBytesinteger

        A smaller file is left in place (Mirth fileSizeMinimum).

      • maxFilesPerPollinteger

        At most this many files per pickup; the rest wait for the next one.

      • recursiveboolean

        Also pick up files in subfolders (at most 10 deep), never in processedPath or errorPath. file.name is relative to remotePath; a moved file lands in processedPath by its own name.

      • ignoreDotboolean

        Skip files and folders whose name starts with a dot.

      • remotePathstringrequired

        The folder to pick files up from.

      • pollIntervalintegerrequired

        Milliseconds between pickups.

      • filenamePatternstring

        A glob (*, ?, [abc]) on the file name.

      • filenameRegexboolean

        filenamePattern is a regular expression matched against the whole name.

      • minFileAgeMsinteger

        A file modified more recently than this may still be being written and waits for a later pickup.

      • maxFileBytesinteger

        A larger file (by its listed size) is never downloaded: it goes to errorPath (or stays) with a size error.

      • sortBystring

        Pickup order: oldest first, by name, or smallest first.

        One of: "modified", "name", "size"

      • encodingstring

        How file bytes are decoded (latin1: ISO-8859-1). binary: the run's content is the bytes as base64, with contentEncoding "base64" (not with batch.mode rows).

        One of: "utf8", "latin1", "windows-1252", "ascii", "utf16le", "binary"

      • afterProcessingstring

        What happens to a file once its runs are recorded. leave: the file stays and never runs again while it is unchanged.

        One of: "move", "delete", "leave"

      • processedPathstring

        Where move puts files (required for move; not remotePath).

      • errorPathstring

        Where a file that is too large, or a CSV that does not parse (rows mode), goes; without it the file stays and the error is recorded.

      • batchobject
        3 fields
        • modestring

          file: one run per file, with { file, content }. rows: one run per CSV row, with { file, row, rowIndex, rowCount }; all rows of a file are recorded together.

          One of: "file", "rows"

        • csvobject

          rows mode: csv-parse options (delimiter, recordDelimiter, quote, escape, header, columns, skipLines, trim, skipEmpty, strictColumns, maxRows at most WORKFLOW_MAX_PENDING).

        • fixedWidthobject

          rows mode, instead of csv: fixed-width-parse options (columns or records, recordDelimiter, recordLength, headerLines, footerLines, unknownRecords, maxRows at most WORKFLOW_MAX_PENDING); one run per record.

      • orderingstring

        fifo: runs execute one at a time in pickup order (files, then rows), across every engine replica.

        One of: "none", "fifo"

      • onErrorstring

        With ordering fifo: what a failed run does to its lane.

        One of: "continue", "hold"

    • type: "file"object

      Picks files up from the folder of a file, ftp, smb, webdav, s3 or sftp adapter profile (a Mirth File Reader over any scheme, P138). Same settings and runs as the sftp trigger; triggerType is "file".

      20 fields
      • typestringrequired

        One of: "file"

      • adapterProfileIdstringrequired

        The adapter profile whose folder the engine polls: its adapter type (file, ftp, smb, webdav, s3 or sftp) is the transport.

      • minFileBytesinteger

        A smaller file is left in place (Mirth fileSizeMinimum).

      • maxFilesPerPollinteger

        At most this many files per pickup; the rest wait for the next one.

      • recursiveboolean

        Also pick up files in subfolders (at most 10 deep), never in processedPath or errorPath. file.name is relative to remotePath; a moved file lands in processedPath by its own name.

      • ignoreDotboolean

        Skip files and folders whose name starts with a dot.

      • remotePathstringrequired

        The folder to pick files up from.

      • pollIntervalintegerrequired

        Milliseconds between pickups.

      • filenamePatternstring

        A glob (*, ?, [abc]) on the file name.

      • filenameRegexboolean

        filenamePattern is a regular expression matched against the whole name.

      • minFileAgeMsinteger

        A file modified more recently than this may still be being written and waits for a later pickup.

      • maxFileBytesinteger

        A larger file (by its listed size) is never downloaded: it goes to errorPath (or stays) with a size error.

      • sortBystring

        Pickup order: oldest first, by name, or smallest first.

        One of: "modified", "name", "size"

      • encodingstring

        How file bytes are decoded (latin1: ISO-8859-1). binary: the run's content is the bytes as base64, with contentEncoding "base64" (not with batch.mode rows).

        One of: "utf8", "latin1", "windows-1252", "ascii", "utf16le", "binary"

      • afterProcessingstring

        What happens to a file once its runs are recorded. leave: the file stays and never runs again while it is unchanged.

        One of: "move", "delete", "leave"

      • processedPathstring

        Where move puts files (required for move; not remotePath).

      • errorPathstring

        Where a file that is too large, or a CSV that does not parse (rows mode), goes; without it the file stays and the error is recorded.

      • batchobject
        3 fields
        • modestring

          file: one run per file, with { file, content }. rows: one run per CSV row, with { file, row, rowIndex, rowCount }; all rows of a file are recorded together.

          One of: "file", "rows"

        • csvobject

          rows mode: csv-parse options (delimiter, recordDelimiter, quote, escape, header, columns, skipLines, trim, skipEmpty, strictColumns, maxRows at most WORKFLOW_MAX_PENDING).

        • fixedWidthobject

          rows mode, instead of csv: fixed-width-parse options (columns or records, recordDelimiter, recordLength, headerLines, footerLines, unknownRecords, maxRows at most WORKFLOW_MAX_PENDING); one run per record.

      • orderingstring

        fifo: runs execute one at a time in pickup order (files, then rows), across every engine replica.

        One of: "none", "fifo"

      • onErrorstring

        With ordering fifo: what a failed run does to its lane.

        One of: "continue", "hold"

    • type: "jms"object

      Consumes a JMS queue or topic over AMQP 1.0 (a Mirth JMS Listener) through a jms adapter profile. One engine replica consumes each trigger. A message is acknowledged to the broker only once its run is recorded, so a crash redelivers it, and the JMS message id dedups the redelivery. A message the filter drops is acknowledged; one that can't be recorded (license, backlog, shutdown) stays on the broker.

      10 fields
      • typestringrequired

        One of: "jms"

      • adapterProfileIdstringrequired

        The jms adapter profile (broker host, login, TLS).

      • destinationstringrequired

        Queue or topic name.

      • destinationTypestring

        One of: "queue", "topic"

      • subscriptionNamestring

        Topics: a durable subscription under this name (the profile's clientId, else medhook-<workflowId>, is its client id), so messages sent while no engine is connected wait for it.

      • selectorstring

        A JMS message selector, applied by the broker.

      • prefetchinteger

        Messages the broker may send ahead of acknowledgement.

      • orderingstring

        One of: "none", "fifo"

      • onErrorstring

        One of: "continue", "hold"

      • deduplicateboolean
    • type: "soap"object

      A SOAP 1.1/1.2 endpoint at /api/triggers/soap/{listenerId} with its WSDL at ?wsdl (a Mirth Web Service Listener).

      15 fields
      • typestringrequired

        One of: "soap"

      • listenerIdstringrequired
      • serviceNamestring

        The generated WSDL's service name.

      • namespacestring

        The generated WSDL's target namespace.

      • soapVersionstring

        One of: "1.1", "1.2", "both"

      • operationsarray of string

        Operation (Body element) names it takes; empty takes any.

      • wsSecuritystring

        One of: "none", "UsernameToken"

      • wsUsernamestring
      • wsPasswordstring

        Write-only: stored encrypted, read back as __set__.

      • secretstring

        HMAC-SHA256 key for x-webhook-signature. Write-only, read back as __set__.

      • wsdlstring

        A WSDL to serve instead of the generated one.

      • responseobject
        3 fields
        • modestring

          One of: "accepted", "destination"

        • nodeIdstring
        • timeoutMsinteger
      • orderingstring

        One of: "none", "fifo"

      • onErrorstring

        One of: "continue", "hold"

      • deduplicateboolean
  • metadataobject

    Arbitrary workflow-level metadata.

    1 field
    • handlesPHIboolean

      When true the engine requires a BAA-enabled license before executing.

  • createdBystring
  • createdAtstring (date-time)
  • updatedAtstring (date-time)
  • ownerstring | null

    Who owns the workflow (Settings · General). Changed with PATCH; null = not set.

  • tagsarray of string

    Lowercased tags (Settings · General). Changed with PATCH.

  • maxInFlightinteger | null

    Most runs of this workflow the work runner starts at once across replicas: queued messages and polls wait while that many run (Settings · Delivery). A manual run is not held back but counts. Changed with PATCH; null = no limit.

  • dedupTtlHoursinteger

    GET only: how long a duplicate receipt is kept (INBOUND_DEDUP_TTL_HOURS, default 24), the Duplicate messages window.

  • maxWorkflowRetriesinteger | null

    Max times to retry the entire workflow after top-level failure. Each retry is a durable pending execution due after the backoff: it survives a restart and holds no queue slot or ordering lane while it waits. Saved with the workflow and its versions; the deployed version's value runs. null = not set (0).

  • workflowRetryDelayMsinteger | null

    Base delay (ms) before the first workflow-level retry; doubles per attempt, capped at 30 minutes.

WorkflowEdge

  • idstringrequired
  • sourcestringrequired
  • targetstringrequired
  • labelstring

    How the edge routes. "error": the failure path of its source step. "true"/"false": a condition (Filter) step's branches. "done": a loop's after-loop edge, run once after the last item with the loop output (without one, the path ends at the loop). Any other label is display text. Edges carry no condition: a request with a non-empty condition is refused (400); branch with a condition (Filter) step instead.

WorkflowNode

  • idstringrequired
  • typestringrequired

    respond: answers a webhook caller (the trigger must be a webhook; one per workflow; in a channel it is a destination's send). data.statusCode (2xx, 4xx or 5xx, default 200; not 401, 403, 409, 413, 429 or 503, which the webhook route answers itself), data.contentType, data.headers (name: Latin-1 value, at most 20; not Content-Type, Content-Length, Set-Cookie, Location, Refresh, Clear-Site-Data, Strict-Transport-Security, Access-Control-*, Content-Security-Policy* or Cross-Origin-*), data.timeoutMs (1000-60000, how long the caller waits) and data.errorStatus (4xx or 5xx, not the reserved ones, default 502, what a failed run answers); the step's input is the body. Without its own custom or destination response setting, the webhook waits for the run and answers this. component: data.componentId and data.release ("1.0.0") pin a release of a component in the same workspace; its steps run inline in this run (each one a step of the trace, ids "<step>~<inner>"), between a check of its inputs and of its outputs, and only its declared outputs go on. publish: data.topic names a topic in the same workspace; the message is checked against its schema and delivered once to every workflow with a topic trigger on it, as queued runs (not waited for). In a router branch it is the destination's send. router: each non-error outgoing edge is one isolated destination (filter → map → send). data.order "concurrent" (default) starts them all at once; "sequential" runs them one after another in edge order, a failed destination never stopping the next, and each later destination's JavaScript outputs and filters read the earlier ones as the frozen responses global: responses[name] = { status: sent | discarded (a Sink, live or test) | queued | filtered | failed | not-run, dryRun (true in a dry run or step test: status reads "sent" as in a live run, but nothing was sent; the trace shows WOULD SEND), data (the send step's output), error }. loop: runs its body per item; its "done" edge continues after the last item. trigger: the start node passes the message through; mid-graph, data.workflowId names a workflow in the same workspace that is started as a queued run with the message (data.input merged into a record message) and not waited for; chains stop at 5 levels. A "wait" step is refused (removed).

    One of: "adapter", "transform", "condition", "parallel", "router", "loop", "trigger", "publish", "component", "respond", "collector"

  • labelstringrequired
  • positionobjectrequired
    2 fields
    • xnumberrequired
    • ynumberrequired
  • dataobjectrequired

    Node-type-specific configuration. Shape varies by type (AdapterStepData, TransformStepData, ConditionStepData, etc.). Any step may carry errorHandling (ErrorHandling). A transform step's mapping rows are FieldMapping and its config options TransformStepConfig, both checked at save.

    3 fields
    • errorHandlingErrorHandling

      What a failed step does. Step retries wait in-process within one run, so each wait is capped at 60 s and the attempts at 10; longer waits are workflow retries (maxWorkflowRetries), which are durable.

    • mappingarray of FieldMapping
    • Options of a transform step (checked at save). Other keys are type-specific (fhir-to-hl7v2, fhir-bulk-split).

WorkflowTemplate

  • idstringrequired
  • namestringrequired
  • descriptionstring
  • categorystring

    One of: "fhir", "hl7", "general", "etl"

  • tagsarray of string
  • iconstring
  • shapestring

    The pattern the template follows.

    One of: "receive-forward", "request-respond", "poll-push", "sync", "batch"

  • groupstring

    Card kicker / category chip.

  • needsarray of object

    What it needs set up first: a tunnel, a profile per adapter type.

    3 fields
    • kindstringrequired

      One of: "tunnel", "adapter"

    • adapterTypestring
    • labelstringrequired
  • nodesarray of WorkflowNode
  • edgesarray of WorkflowEdge

WorkflowTestCase

  • idstring
  • namestring
  • createdAtstring (date-time)
  • updatedAtstring (date-time)
  • createdBystring
  • bytesinteger

    Size of the input message.

  • messageTypestring | null

    MSH-9 type^event (HL7 v2) or resourceType (FHIR); null otherwise. Never content.

  • hasExpectedOutputboolean
  • stepOutputCountinteger

    A step case's saved step outputs (compared on each run); 0 for a whole-workflow case.

  • assertionCountinteger
  • stepIdsarray of string

    The steps the case tests (Run with sample); [] = the whole workflow.

  • startAtstring

    How the input reaches the steps: message or step-input.

  • fromRealMessageboolean

    The input is a real message (pinned from an execution or a recent message): its read is masked unless revealed.

WorkflowTestCasesRun

  • totalinteger
  • passedinteger
  • failedinteger
  • resultsarray of object
    8 fields
    • idstring
    • namestring
    • passedboolean
    • diffCountinteger
    • diffFieldsarray of string

      Names of the fields that differ, never values.

    • failedAssertionsarray of object
      4 fields
      • fieldstring
      • opstring
      • expectedstring
      • actualstring
    • brokenStepIdsarray of string

      A step case: the node ids of the steps whose output no longer matches, or that failed.

    • errorstring

      Why the dry run gave no output. A step case: its steps are gone (steps-missing) or the sample stopped before them (not-reached).

      One of: "filtered", "failed", "timeout", "steps-missing", "not-reached"