---
title: "Call a Workflow Call a Workflow"
method: POST
path: "/v3/workflows/{workflowName}/call"
tags: ["Workflows"]
---

# Call a Workflow Call a Workflow

`POST /v3/workflows/{workflowName}/call`

**Invoke a workflow.**

Submit the input file as either a multipart form request or a JSON request with
base64-encoded file content. The workflow name is derived from the URL path.

## Input Formats

- **Multipart form** (`multipart/form-data`): attach the file directly via the `file`
or `files` fields. Set `wait` in the form body to control synchronous behaviour.
- **JSON** (`application/json`): base64-encode the file content and set it in
`input.singleFile.inputContent` or `input.batchFiles.inputs[*].inputContent`.
Pass `wait=true` as a query parameter to control synchronous behaviour.

## Synchronous vs Asynchronous

By default the call is created asynchronously and this endpoint returns `202 Accepted`
immediately with a `pending` call object. Set `wait` to `true` to block until
the call completes (up to 30 seconds):

- On success: returns `200 OK` with the completed call, `outputs` populated
- On failure: returns `500 Internal Server Error` with the call and an `error` message
- On timeout: returns `202 Accepted` with the still-running call

## Tracking

Poll `GET /v3/calls/{callID}` to check status, or configure a webhook subscription
to receive events when the call finishes.

## CLI Usage

Use `@path/to/file` inside JSON string values to embed file contents automatically.
Binary files (PDF, images, audio) are base64-encoded; text files are embedded as strings.

Single file (synchronous):
```bash
bem workflows call \
  --workflow-name my-workflow \
  --input.single-file '{"inputContent": "@invoice.pdf", "inputType": "pdf"}' \
  --wait
```

Single file (asynchronous, returns callID immediately):
```bash
bem workflows call \
  --workflow-name my-workflow \
  --input.single-file '{"inputContent": "@invoice.pdf", "inputType": "pdf"}'
```

Batch files:
```bash
bem workflows call \
  --workflow-name my-workflow \
  --input.batch-files '{"inputs": [{"inputContent": "@a.pdf", "inputType": "pdf"}, {"inputContent": "@b.png", "inputType": "png"}]}'
```

Alternative: pass the full `--input` flag as JSON:
```bash
bem workflows call \
  --workflow-name my-workflow \
  --input '{"singleFile": {"inputContent": "@invoice.pdf", "inputType": "pdf"}}' \
  --wait
```

**Important:** `--wait` is a boolean flag. Use `--wait` or `--wait=true`.
Do **not** use `--wait true` (with a space) — the `true` will be parsed as an
unexpected positional argument.

Supported `inputType` values: csv, docx, email, heic, heif, html, jfif, jpeg,
json, m4a, mp3, mov, mp4, pdf, png, pptx, text, wav, webp, xls, xlsx, xml.
`jfif` (and `jpg`) are normalized to `jpeg`.

## Path parameters

- `workflowName` string, required

## Query parameters

- `wait` boolean

## Request body

- WorkflowCallJsonBody — JSON request body for POST /v3/workflows/{workflowName}/call.
  - `callReferenceID` string — Your reference ID for tracking this call.
  - `metadata` object — Arbitrary JSON object attached to this call. Stored on the call record and injected into `transformedContent` under the reserved `_metadata` key (alongside `referenceID`). Must be a JSON object. Maximum size: 4 KB.
  - `input` FunctionCallCreateInput, required — Input file(s) for a call. Provide exactly one of `singleFile` or `batchFiles`. In the CLI, use the nested flags `--input.single-file` or `--input.batch-files` with `@path/to/file` for automatic file embedding: `--input.single-file '{"inputContent": "@invoice.pdf", "inputType": "pdf"}' --wait`
    - `singleFile` FileInput — A single file input with base64-encoded content. When using the Bem CLI, use `@path/to/file` in the `inputContent` field to automatically read and base64-encode the file: `--input.single-file '{"inputContent": "@file.pdf", "inputType": "pdf"}' --wait`
      - `inputType` 'csv' | 'docx' | 'email' | 'heic' | 'html' | 'jfif' | 'jpeg' | 'json' | 'heif' | 'm4a' | 'mov' | 'mp3' | 'mp4' | 'pdf' | 'png' | 'pptx' | 'text' | 'wav' | 'webp' | 'xls' | 'xlsx' | 'xml', required — The input type of the content you're sending for transformation. `jfif` is accepted as an alias for `jpeg` — JFIF is the same format under a different extension — and is normalized to `jpeg`, so responses and webhooks report `jpeg` for a JFIF upload. The undeclared alias `jpg` behaves the same way.
      - `inputContent` string, byte, required — Base64-encoded file content. In the Bem CLI, use `@path/to/file` to embed file contents automatically.
    - `batchFiles` BatchFilesInput
      - `inputs` object[]
        - `inputType` 'csv' | 'docx' | 'email' | 'heic' | 'html' | 'jfif' | 'jpeg' | 'json' | 'heif' | 'm4a' | 'mov' | 'mp3' | 'mp4' | 'pdf' | 'png' | 'pptx' | 'text' | 'wav' | 'webp' | 'xls' | 'xlsx' | 'xml', required — The input type of the content you're sending for transformation. `jfif` is accepted as an alias for `jpeg` — JFIF is the same format under a different extension — and is normalized to `jpeg`, so responses and webhooks report `jpeg` for a JFIF upload. The undeclared alias `jpg` behaves the same way.
        - `inputContent` string, byte, required — Base64-encoded file content. In the Bem CLI, use `@path/to/file` to embed file contents automatically.
        - `itemReferenceID` string
  - `bucket` string — Optional bucket NAME that entities extracted by the workflow's parse function(s) land in. Resolution precedence: this call-level bucket > the parse function's configured `defaultBucket` > the account+environment default bucket. A non-existent bucket name returns 400, but only when the workflow contains a parse function; on a parse-free workflow it is ignored.

## Response `200`

The request has succeeded.

- CallGetResponseV3
  - `call` CallV3 — A workflow call returned by the V3 API. Compared to the V2 `Call` model: - Terminal outputs are split into `outputs` (non-error events) and `errors` (error events) - `callType` and function-scoped fields are removed — V3 calls are always workflow calls - The deprecated `functionCalls` field is removed (use `GET /v3/calls/{callID}/trace`) - `url` and `traceUrl` hint fields are included for resource discovery
    - `callID` string, required — Unique identifier of the call.
    - `status` 'pending' | 'running' | 'completed' | 'failed' — Status of call.
    - `createdAt` string, date-time, required — The date and time the call was created.
    - `finishedAt` string, date-time — The date and time the call finished. Only set once status is `completed` or `failed`.
    - `workflowID` string — Unique identifier of the workflow.
    - `workflowName` string — Name of the workflow.
    - `workflowVersionNum` integer — Version number of the workflow.
    - `callReferenceID` string — Your reference ID for this call, propagated from the original request.
    - `outputs` EventV3[], required — Terminal non-error outputs of this call: primary events (non-split-collection) that did not trigger any downstream function calls. Workflow calls are not atomic — `outputs` and `errors` may both be non-empty if some enclosed function calls succeeded and others failed. Each element is a polymorphic event object; inspect `eventType` to determine the type. Retrieve individual outputs via `GET /v3/outputs/{eventID}`.
      - union — V3 read-side event union. Superset of the shared `Event` union: it contains every shared variant verbatim (backward compatible) and adds the V3-only `extract`, `parse`, `classify`, `analyze`, `payload_shaping`, and `evaluation` variants. This is also the union delivered as the body of outbound webhook payloads.
        - object
          - `functionCallTryNumber` integer — The attempt number of the function call that created this event. 1 indexed.
          - `eventID` string, required — Unique ID generated by bem to identify the event.
          - `createdAt` string, date-time — Timestamp indicating when the event was created.
          - `referenceID` string, required — The unique ID you use internally to refer to this data point, propagated from the original function input.
          - `inboundEmail` EventInboundEmail
            - `to` string, required — The email address of the recipient.
            - `deliveredTo` string — The email address of the original intended recipient if the email itself was forwarded.
            - `from` string, required — The email address of the sender.
            - `subject` string, required — The subject of the email.
          - `metadata` object
            - `durationFunctionToEventSeconds` number
          - `eventType` 'transform'
          - `functionCallID` string — Unique identifier of function call that this event is associated with.
          - `functionID` string, required — Unique identifier of function that this event is associated with.
          - `functionName` string, required — Unique name of function that this event is associated with.
          - `functionVersionNum` integer — Version number of function that this event is associated with.
          - `callID` string — Unique identifier of workflow call that this event is associated with.
          - `workflowID` string — Unique identifier of workflow that this event is associated with.
          - `workflowName` string — Name of workflow that this event is associated with.
          - `workflowVersionNum` integer — Version number of workflow that this event is associated with.
          - `pipelineID` string — ID of pipeline that transformed the original input data.
          - `publishedAt` string, date-time — Timestamp indicating when the transform was published via webhook and received a successful 200 response. Value is `null` if the transformation hasn't been sent.
          - `lastPublishErrorAt` string, nullable — Last timestamp indicating when the transform was published via webhook and received a non-200 response. Set to `null` on a subsequent retry if the webhook service receives a 200 response.
          - `inputType` 'csv' | 'docx' | 'email' | 'heic' | 'html' | 'jfif' | 'jpeg' | 'json' | 'heif' | 'm4a' | 'mov' | 'mp3' | 'mp4' | 'pdf' | 'png' | 'pptx' | 'text' | 'wav' | 'webp' | 'xls' | 'xlsx' | 'xml' — The input type of the content you're sending for transformation. `jfif` is accepted as an alias for `jpeg` — JFIF is the same format under a different extension — and is normalized to `jpeg`, so responses and webhooks report `jpeg` for a JFIF upload. The undeclared alias `jpg` behaves the same way.
          - `transformationID` string — Unique ID for each transformation output generated by bem following Segment's KSUID conventions.
          - `s3URL` string, nullable — Presigned S3 URL for the input content uploaded to S3.
          - `inputs` object[], nullable — Array of transformation inputs with their types and S3 URLs.
            - `inputType` string, nullable
            - `inputContent` string, nullable
            - `jsonInputContent` object, nullable
            - `s3URL` string, nullable
          - `transformedContent` object, required — The transformed content of the input. The structure of this object is defined by the function configuration.
          - `correctedContent` union — Corrected feedback provided for fine-tuning purposes.
            - object
              - …
            - union
              - …
          - `invalidProperties` string[] — List of properties that were invalid in the input.
          - `metrics` object, nullable — Accuracy, precision, recall, and F1 score when corrected JSON is provided.
            - `metrics` object
              - …
            - `differences` object[]
              - …
          - `orderMatching` boolean — Indicates whether array order matters when comparing corrected JSON with extracted JSON.
          - `isRegression` boolean — Indicates whether this transformation was created as part of a regression test.
          - `itemOffset` integer, required — The offset of the first item that was transformed. Used for batch transformations to indicate which item in the batch this event corresponds to.
          - `itemCount` integer, required — The number of items that were transformed. Used for batch transformations to indicate how many items were transformed.
          - `fieldConfidences` object — Per-field confidence scores. A JSON object mapping RFC 6901 JSON Pointer paths (e.g. `"/invoiceNumber"`) to float values in the range [0, 1] indicating the model's confidence in each extracted field value.
          - `avgConfidence` number, float, nullable — Average confidence score across all extracted fields, in the range [0, 1].
        - object — V3 event variants that do not exist in the shared `Event` union. `ExtractEvent` and `ClassifyEvent` are emitted only by V3-era function types (`extract` and `classify`). The shared `Event` union in `specs/events/models.tsp` predates these types and continues to describe V2 / V1-alpha responses verbatim; V3 response payloads add the new variants via the `EventV3` union below while keeping every shared variant intact for backward compatibility.
          - `functionCallTryNumber` integer — The attempt number of the function call that created this event. 1 indexed.
          - `eventID` string, required — Unique ID generated by bem to identify the event.
          - `createdAt` string, date-time — Timestamp indicating when the event was created.
          - `referenceID` string, required — The unique ID you use internally to refer to this data point, propagated from the original function input.
          - `inboundEmail` EventInboundEmail
            - `to` string, required — The email address of the recipient.
            - `deliveredTo` string — The email address of the original intended recipient if the email itself was forwarded.
            - `from` string, required — The email address of the sender.
            - `subject` string, required — The subject of the email.
          - `metadata` object
            - `durationFunctionToEventSeconds` number
          - `eventType` 'extract'
          - `functionCallID` string — Unique identifier of function call that this event is associated with.
          - `functionID` string, required — Unique identifier of function that this event is associated with.
          - `functionName` string, required — Unique name of function that this event is associated with.
          - `functionVersionNum` integer — Version number of function that this event is associated with.
          - `callID` string — Unique identifier of workflow call that this event is associated with.
          - `workflowID` string — Unique identifier of workflow that this event is associated with.
          - `workflowName` string — Name of workflow that this event is associated with.
          - `workflowVersionNum` integer — Version number of workflow that this event is associated with.
          - `inputType` 'csv' | 'docx' | 'email' | 'heic' | 'html' | 'jfif' | 'jpeg' | 'json' | 'heif' | 'm4a' | 'mov' | 'mp3' | 'mp4' | 'pdf' | 'png' | 'pptx' | 'text' | 'wav' | 'webp' | 'xls' | 'xlsx' | 'xml' — The input type of the content you're sending for transformation. `jfif` is accepted as an alias for `jpeg` — JFIF is the same format under a different extension — and is normalized to `jpeg`, so responses and webhooks report `jpeg` for a JFIF upload. The undeclared alias `jpg` behaves the same way.
          - `transformationID` string — Unique ID for each transformation output generated by bem following Segment's KSUID conventions.
          - `s3URL` string, nullable — Presigned S3 URL for the input content uploaded to S3.
          - `inputs` object[], nullable — Array of transformation inputs with their types and S3 URLs.
            - `inputType` string, nullable
            - `inputContent` string, nullable
            - `jsonInputContent` object, nullable
            - `s3URL` string, nullable
          - `transformedContent` object, required — The transformed content of the input. The structure of this object is defined by the function configuration.
          - `correctedContent` union — Corrected feedback provided for fine-tuning purposes.
            - object
              - …
            - union
              - …
          - `invalidProperties` string[] — List of properties that were invalid in the input.
          - `itemOffset` integer, required — The offset of the first item that was transformed. Used for batch transformations to indicate which item in the batch this event corresponds to.
          - `itemCount` integer, required — The number of items that were transformed. Used for batch transformations to indicate how many items were transformed.
          - `fieldBoundingBoxes` object — Per-field bounding boxes. A JSON object mapping RFC 6901 JSON Pointer paths (e.g. `"/invoiceNumber"`, `"/items/0/price"`) to the document regions from which each extracted value was sourced.
          - `fieldConfidences` object — Per-field confidence scores. A JSON object mapping RFC 6901 JSON Pointer paths (e.g. `"/invoiceNumber"`) to float values in the range [0, 1] indicating the model's confidence in each extracted field value.
          - `avgConfidence` number, float, nullable — Average confidence score across all extracted fields, in the range [0, 1].
        - object — Emitted when a `parse` function completes. Reuses the `extract` event shape on the wire — both wrap a Transformation and downstream consumers care about the same `transformedContent` payload — but uses a distinct `eventType` discriminator so receivers can dispatch on the function type that produced it.
          - `functionCallTryNumber` integer — The attempt number of the function call that created this event. 1 indexed.
          - `eventID` string, required — Unique ID generated by bem to identify the event.
          - `createdAt` string, date-time — Timestamp indicating when the event was created.
          - `referenceID` string, required — The unique ID you use internally to refer to this data point, propagated from the original function input.
          - `inboundEmail` EventInboundEmail
            - `to` string, required — The email address of the recipient.
            - `deliveredTo` string — The email address of the original intended recipient if the email itself was forwarded.
            - `from` string, required — The email address of the sender.
            - `subject` string, required — The subject of the email.
          - `metadata` object
            - `durationFunctionToEventSeconds` number
          - `eventType` 'parse'
          - `functionCallID` string — Unique identifier of function call that this event is associated with.
          - `functionID` string, required — Unique identifier of function that this event is associated with.
          - `functionName` string, required — Unique name of function that this event is associated with.
          - `functionVersionNum` integer — Version number of function that this event is associated with.
          - `callID` string — Unique identifier of workflow call that this event is associated with.
          - `workflowID` string — Unique identifier of workflow that this event is associated with.
          - `workflowName` string — Name of workflow that this event is associated with.
          - `workflowVersionNum` integer — Version number of workflow that this event is associated with.
          - `inputType` 'csv' | 'docx' | 'email' | 'heic' | 'html' | 'jfif' | 'jpeg' | 'json' | 'heif' | 'm4a' | 'mov' | 'mp3' | 'mp4' | 'pdf' | 'png' | 'pptx' | 'text' | 'wav' | 'webp' | 'xls' | 'xlsx' | 'xml' — The input type of the content you're sending for transformation. `jfif` is accepted as an alias for `jpeg` — JFIF is the same format under a different extension — and is normalized to `jpeg`, so responses and webhooks report `jpeg` for a JFIF upload. The undeclared alias `jpg` behaves the same way.
          - `transformationID` string — Unique ID for each transformation output generated by bem following Segment's KSUID conventions.
          - `s3URL` string, nullable — Presigned S3 URL for the input content uploaded to S3.
          - `inputs` object[], nullable — Array of parse inputs with their types and S3 URLs.
            - `inputType` string, nullable
            - `inputContent` string, nullable
            - `jsonInputContent` object, nullable
            - `s3URL` string, nullable
          - `transformedContent` object, required — The parsed content of the input. Top-level keys are `sections`, `entities`, and `relationships`; the precise shape is determined by the parse function's configuration.
          - `correctedContent` union — Corrected feedback provided for fine-tuning purposes.
            - object
              - …
            - union
              - …
          - `invalidProperties` string[] — List of properties that were invalid in the input.
          - `itemOffset` integer, required — The offset of the first item that was parsed. Used for batch parsing to indicate which item in the batch this event corresponds to.
          - `itemCount` integer, required — The number of items that were parsed. Used for batch parsing to indicate how many items were parsed.
          - `fieldBoundingBoxes` object — Per-field bounding boxes. A JSON object mapping RFC 6901 JSON Pointer paths to the document regions from which each parsed value was sourced.
          - `fieldConfidences` object — Per-field confidence scores. A JSON object mapping RFC 6901 JSON Pointer paths to float values in the range [0, 1] indicating the model's confidence in each parsed field value.
          - `avgConfidence` number, float, nullable — Average confidence score across all parsed fields, in the range [0, 1].
        - object — Emitted by functions of the legacy `analyze` type (the vision path predecessor of `extract`). Carries the extracted JSON along with per-field bounding-box metadata identifying the document regions each value was extracted from.
          - `functionCallTryNumber` integer — The attempt number of the function call that created this event. 1 indexed.
          - `eventID` string, required — Unique ID generated by bem to identify the event.
          - `createdAt` string, date-time — Timestamp indicating when the event was created.
          - `referenceID` string, required — The unique ID you use internally to refer to this data point, propagated from the original function input.
          - `inboundEmail` EventInboundEmail
            - `to` string, required — The email address of the recipient.
            - `deliveredTo` string — The email address of the original intended recipient if the email itself was forwarded.
            - `from` string, required — The email address of the sender.
            - `subject` string, required — The subject of the email.
          - `metadata` object
            - `durationFunctionToEventSeconds` number
          - `eventType` 'analyze'
          - `functionCallID` string — Unique identifier of function call that this event is associated with.
          - `functionID` string, required — Unique identifier of function that this event is associated with.
          - `functionName` string, required — Unique name of function that this event is associated with.
          - `functionVersionNum` integer — Version number of function that this event is associated with.
          - `callID` string — Unique identifier of workflow call that this event is associated with.
          - `workflowID` string — Unique identifier of workflow that this event is associated with.
          - `workflowName` string — Name of workflow that this event is associated with.
          - `workflowVersionNum` integer — Version number of workflow that this event is associated with.
          - `transformationID` string, nullable — Unique ID for each transformation output generated by bem following Segment's KSUID conventions.
          - `transformedContent` object, required — The extracted content of the input. The structure of this object is defined by the function's `outputSchema`.
          - `invalidProperties` string[], required — List of properties that were invalid in the input.
          - `s3URL` string, nullable — Presigned S3 URL of the input file that was analyzed.
          - `fieldBoundingBoxes` object — Per-field bounding boxes. A JSON object mapping RFC 6901 JSON Pointer paths (e.g. `"/invoiceNumber"`, `"/items/0/price"`) to the document regions from which each extracted value was sourced.
          - `fieldConfidences` object — Per-field confidence scores. A JSON object mapping RFC 6901 JSON Pointer paths to float values in the range [0, 1] indicating the model's confidence in each extracted field value.
          - `avgConfidence` number, float, nullable — Average confidence score across all extracted fields, in the range [0, 1].
        - object
          - `functionCallTryNumber` integer — The attempt number of the function call that created this event. 1 indexed.
          - `eventID` string, required — Unique ID generated by bem to identify the event.
          - `createdAt` string, date-time — Timestamp indicating when the event was created.
          - `referenceID` string, required — The unique ID you use internally to refer to this data point, propagated from the original function input.
          - `inboundEmail` EventInboundEmail
            - `to` string, required — The email address of the recipient.
            - `deliveredTo` string — The email address of the original intended recipient if the email itself was forwarded.
            - `from` string, required — The email address of the sender.
            - `subject` string, required — The subject of the email.
          - `metadata` object
            - `durationFunctionToEventSeconds` number
          - `eventType` 'route'
          - `functionCallID` string — Unique identifier of function call that this event is associated with.
          - `functionID` string, required — Unique identifier of function that this event is associated with.
          - `functionName` string, required — Unique name of function that this event is associated with.
          - `functionVersionNum` integer — Version number of function that this event is associated with.
          - `callID` string — Unique identifier of workflow call that this event is associated with.
          - `workflowID` string — Unique identifier of workflow that this event is associated with.
          - `workflowName` string — Name of workflow that this event is associated with.
          - `workflowVersionNum` integer — Version number of workflow that this event is associated with.
          - `choice` string, required — The choice made by the router function.
          - `s3URL` string — The presigned S3 URL of the file that was routed.
        - object
          - `functionCallTryNumber` integer — The attempt number of the function call that created this event. 1 indexed.
          - `eventID` string, required — Unique ID generated by bem to identify the event.
          - `createdAt` string, date-time — Timestamp indicating when the event was created.
          - `referenceID` string, required — The unique ID you use internally to refer to this data point, propagated from the original function input.
          - `inboundEmail` EventInboundEmail
            - `to` string, required — The email address of the recipient.
            - `deliveredTo` string — The email address of the original intended recipient if the email itself was forwarded.
            - `from` string, required — The email address of the sender.
            - `subject` string, required — The subject of the email.
          - `metadata` object
            - `durationFunctionToEventSeconds` number
          - `eventType` 'classify'
          - `functionCallID` string — Unique identifier of function call that this event is associated with.
          - `functionID` string, required — Unique identifier of function that this event is associated with.
          - `functionName` string, required — Unique name of function that this event is associated with.
          - `functionVersionNum` integer — Version number of function that this event is associated with.
          - `callID` string — Unique identifier of workflow call that this event is associated with.
          - `workflowID` string — Unique identifier of workflow that this event is associated with.
          - `workflowName` string — Name of workflow that this event is associated with.
          - `workflowVersionNum` integer — Version number of workflow that this event is associated with.
          - `choice` string, required — The classification chosen by the classify function.
          - `s3URL` string — The presigned S3 URL of the file that was classified.
        - object
          - `functionCallTryNumber` integer — The attempt number of the function call that created this event. 1 indexed.
          - `eventID` string, required — Unique ID generated by bem to identify the event.
          - `createdAt` string, date-time — Timestamp indicating when the event was created.
          - `referenceID` string, required — The unique ID you use internally to refer to this data point, propagated from the original function input.
          - `inboundEmail` EventInboundEmail
            - `to` string, required — The email address of the recipient.
            - `deliveredTo` string — The email address of the original intended recipient if the email itself was forwarded.
            - `from` string, required — The email address of the sender.
            - `subject` string, required — The subject of the email.
          - `metadata` object
            - `durationFunctionToEventSeconds` number
          - `eventType` 'split_collection'
          - `functionCallID` string — Unique identifier of function call that this event is associated with.
          - `functionID` string, required — Unique identifier of function that this event is associated with.
          - `functionName` string, required — Unique name of function that this event is associated with.
          - `functionVersionNum` integer — Version number of function that this event is associated with.
          - `callID` string — Unique identifier of workflow call that this event is associated with.
          - `workflowID` string — Unique identifier of workflow that this event is associated with.
          - `workflowName` string — Name of workflow that this event is associated with.
          - `workflowVersionNum` integer — Version number of workflow that this event is associated with.
          - `outputType` 'print_page' | 'semantic_page', required
          - `printPageOutput` object, required
            - `itemCount` integer
            - `items` object[]
              - …
          - `semanticPageOutput` object, required
            - `pageCount` integer
            - `itemCount` integer
            - `items` object[]
              - …
        - object
          - `functionCallTryNumber` integer — The attempt number of the function call that created this event. 1 indexed.
          - `eventID` string, required — Unique ID generated by bem to identify the event.
          - `createdAt` string, date-time — Timestamp indicating when the event was created.
          - `referenceID` string, required — The unique ID you use internally to refer to this data point, propagated from the original function input.
          - `inboundEmail` EventInboundEmail
            - `to` string, required — The email address of the recipient.
            - `deliveredTo` string — The email address of the original intended recipient if the email itself was forwarded.
            - `from` string, required — The email address of the sender.
            - `subject` string, required — The subject of the email.
          - `metadata` object
            - `durationFunctionToEventSeconds` number
          - `eventType` 'split_item'
          - `functionCallID` string — Unique identifier of function call that this event is associated with.
          - `functionID` string, required — Unique identifier of function that this event is associated with.
          - `functionName` string, required — Unique name of function that this event is associated with.
          - `functionVersionNum` integer — Version number of function that this event is associated with.
          - `callID` string — Unique identifier of workflow call that this event is associated with.
          - `workflowID` string — Unique identifier of workflow that this event is associated with.
          - `workflowName` string — Name of workflow that this event is associated with.
          - `workflowVersionNum` integer — Version number of workflow that this event is associated with.
          - `outputType` 'print_page' | 'semantic_page', required
          - `printPageOutput` object
            - `collectionReferenceID` string
            - `itemCount` integer
            - `itemOffset` integer
            - `s3URL` string
          - `semanticPageOutput` object
            - `collectionReferenceID` string
            - `pageCount` integer
            - `itemCount` integer
            - `itemOffset` integer
            - `itemClass` string
            - `itemClassCount` integer
            - `itemClassOffset` integer
            - `pageStart` integer
            - `pageEnd` integer
            - `s3URL` string
        - object
          - `functionCallTryNumber` integer — The attempt number of the function call that created this event. 1 indexed.
          - `eventID` string, required — Unique ID generated by bem to identify the event.
          - `createdAt` string, date-time — Timestamp indicating when the event was created.
          - `referenceID` string, required — The unique ID you use internally to refer to this data point, propagated from the original function input.
          - `inboundEmail` EventInboundEmail
            - `to` string, required — The email address of the recipient.
            - `deliveredTo` string — The email address of the original intended recipient if the email itself was forwarded.
            - `from` string, required — The email address of the sender.
            - `subject` string, required — The subject of the email.
          - `metadata` object
            - `durationFunctionToEventSeconds` number
          - `eventType` 'error'
          - `functionCallID` string — Unique identifier of function call that this event is associated with.
          - `functionID` string, required — Unique identifier of function that this event is associated with.
          - `functionName` string, required — Unique name of function that this event is associated with.
          - `functionVersionNum` integer — Version number of function that this event is associated with.
          - `callID` string — Unique identifier of workflow call that this event is associated with.
          - `workflowID` string — Unique identifier of workflow that this event is associated with.
          - `workflowName` string — Name of workflow that this event is associated with.
          - `workflowVersionNum` integer — Version number of workflow that this event is associated with.
          - `message` string, required — Error message.
          - `kind` string — Open, extensible error-kind label for typed transformation errors. The platform emits these as plain strings and the set grows over time, so clients must accept unknown values. For render functions the known kinds are `render_source_fetch`, `render_template_fetch`, `render_image_unresolved`, `render_validation`, `render_exception`, `render_upload`, and `render_contract`. Omitted for historical events that pre-date the kind column and for non-transform errors.
        - object
          - `functionCallTryNumber` integer — The attempt number of the function call that created this event. 1 indexed.
          - `eventID` string, required — Unique ID generated by bem to identify the event.
          - `createdAt` string, date-time — Timestamp indicating when the event was created.
          - `referenceID` string, required — The unique ID you use internally to refer to this data point, propagated from the original function input.
          - `inboundEmail` EventInboundEmail
            - `to` string, required — The email address of the recipient.
            - `deliveredTo` string — The email address of the original intended recipient if the email itself was forwarded.
            - `from` string, required — The email address of the sender.
            - `subject` string, required — The subject of the email.
          - `metadata` object
            - `durationFunctionToEventSeconds` number
          - `eventType` 'join'
          - `functionCallID` string — Unique identifier of function call that this event is associated with.
          - `functionID` string, required — Unique identifier of function that this event is associated with.
          - `functionName` string, required — Unique name of function that this event is associated with.
          - `functionVersionNum` integer — Version number of function that this event is associated with.
          - `callID` string — Unique identifier of workflow call that this event is associated with.
          - `workflowID` string — Unique identifier of workflow that this event is associated with.
          - `workflowName` string — Name of workflow that this event is associated with.
          - `workflowVersionNum` integer — Version number of workflow that this event is associated with.
          - `joinType` 'standard', required — The type of join that was performed.
          - `transformationID` string — Unique ID for each transformation output generated by bem following Segment's KSUID conventions.
          - `transformedContent` object, required — The transformed content of the input. The structure of this object is defined by the function configuration.
          - `invalidProperties` string[], required — List of properties that were invalid in the input.
          - `items` JoinEventItem[], required — The items that were joined.
            - `itemReferenceID` string, required — The unique ID you use internally to refer to this data point.
            - `itemOffset` integer, required — The offset of the first item that was transformed. Used for batch transformations to indicate which item in the batch this event corresponds to.
            - `itemCount` integer, required — The number of items that were transformed.
            - `s3URL` string — The presigned S3 URL of the file that was joined.
          - `fieldConfidences` object — Per-field confidence scores. A JSON object mapping RFC 6901 JSON Pointer paths (e.g. `"/invoiceNumber"`) to float values in the range [0, 1] indicating the model's confidence in each extracted field value.
          - `avgConfidence` number, float, nullable — Average confidence score across all extracted fields, in the range [0, 1].
        - object
          - `functionCallTryNumber` integer — The attempt number of the function call that created this event. 1 indexed.
          - `eventID` string, required — Unique ID generated by bem to identify the event.
          - `createdAt` string, date-time — Timestamp indicating when the event was created.
          - `referenceID` string, required — The unique ID you use internally to refer to this data point, propagated from the original function input.
          - `inboundEmail` EventInboundEmail
            - `to` string, required — The email address of the recipient.
            - `deliveredTo` string — The email address of the original intended recipient if the email itself was forwarded.
            - `from` string, required — The email address of the sender.
            - `subject` string, required — The subject of the email.
          - `metadata` object
            - `durationFunctionToEventSeconds` number
          - `eventType` 'enrich'
          - `functionCallID` string — Unique identifier of function call that this event is associated with.
          - `functionID` string, required — Unique identifier of function that this event is associated with.
          - `functionName` string, required — Unique name of function that this event is associated with.
          - `functionVersionNum` integer — Version number of function that this event is associated with.
          - `callID` string — Unique identifier of workflow call that this event is associated with.
          - `workflowID` string — Unique identifier of workflow that this event is associated with.
          - `workflowName` string — Name of workflow that this event is associated with.
          - `workflowVersionNum` integer — Version number of workflow that this event is associated with.
          - `enrichedContent` object, required — The enriched content produced by the enrich function. Contains the input data augmented with results from semantic search against collections.
        - object — Emitted by `payload_shaping` functions, which restructure JSON payloads using JMESPath expressions configured on the function. The shaped result is carried in `transformedContent`.
          - `functionCallTryNumber` integer — The attempt number of the function call that created this event. 1 indexed.
          - `eventID` string, required — Unique ID generated by bem to identify the event.
          - `createdAt` string, date-time — Timestamp indicating when the event was created.
          - `referenceID` string, required — The unique ID you use internally to refer to this data point, propagated from the original function input.
          - `inboundEmail` EventInboundEmail
            - `to` string, required — The email address of the recipient.
            - `deliveredTo` string — The email address of the original intended recipient if the email itself was forwarded.
            - `from` string, required — The email address of the sender.
            - `subject` string, required — The subject of the email.
          - `metadata` object
            - `durationFunctionToEventSeconds` number
          - `eventType` 'payload_shaping'
          - `functionCallID` string — Unique identifier of function call that this event is associated with.
          - `functionID` string, required — Unique identifier of function that this event is associated with.
          - `functionName` string, required — Unique name of function that this event is associated with.
          - `functionVersionNum` integer — Version number of function that this event is associated with.
          - `callID` string — Unique identifier of workflow call that this event is associated with.
          - `workflowID` string — Unique identifier of workflow that this event is associated with.
          - `workflowName` string — Name of workflow that this event is associated with.
          - `workflowVersionNum` integer — Version number of workflow that this event is associated with.
          - `transformedContent` object, required — The reshaped payload produced by applying the function's JMESPath expressions to the input data.
        - object — Emitted when a function-accuracy evaluation completes for a transformation. Evaluations are scheduled by `POST /v3/eval` and run asynchronously; this event reports the terminal result.
          - `functionCallTryNumber` integer — The attempt number of the function call that created this event. 1 indexed.
          - `eventID` string, required — Unique ID generated by bem to identify the event.
          - `createdAt` string, date-time — Timestamp indicating when the event was created.
          - `referenceID` string, required — The unique ID you use internally to refer to this data point, propagated from the original function input.
          - `inboundEmail` EventInboundEmail
            - `to` string, required — The email address of the recipient.
            - `deliveredTo` string — The email address of the original intended recipient if the email itself was forwarded.
            - `from` string, required — The email address of the sender.
            - `subject` string, required — The subject of the email.
          - `metadata` object
            - `durationFunctionToEventSeconds` number
          - `eventType` 'evaluation'
          - `functionCallID` string — Unique identifier of function call that this event is associated with.
          - `functionID` string, required — Unique identifier of function that this event is associated with.
          - `functionName` string, required — Unique name of function that this event is associated with.
          - `functionVersionNum` integer — Version number of function that this event is associated with.
          - `callID` string — Unique identifier of workflow call that this event is associated with.
          - `workflowID` string — Unique identifier of workflow that this event is associated with.
          - `workflowName` string — Name of workflow that this event is associated with.
          - `workflowVersionNum` integer — Version number of workflow that this event is associated with.
          - `transformId` string, required — Unique ID of the transformation that was evaluated.
          - `evaluationVersion` string, required — Version identifier of the evaluation logic that produced this result.
          - `result` object, required — Evaluator output. Shape depends on `evaluationVersion` and includes confidence scores, per-field hallucination flags, and relevance metrics.
          - `status` 'success' | 'failed', required — Terminal status of the evaluation run.
          - `errorMessage` string — Failure reason populated when `status` is `failed`.
        - object
          - `functionCallTryNumber` integer — The attempt number of the function call that created this event. 1 indexed.
          - `eventID` string, required — Unique ID generated by bem to identify the event.
          - `createdAt` string, date-time — Timestamp indicating when the event was created.
          - `referenceID` string, required — The unique ID you use internally to refer to this data point, propagated from the original function input.
          - `inboundEmail` EventInboundEmail
            - `to` string, required — The email address of the recipient.
            - `deliveredTo` string — The email address of the original intended recipient if the email itself was forwarded.
            - `from` string, required — The email address of the sender.
            - `subject` string, required — The subject of the email.
          - `metadata` object
            - `durationFunctionToEventSeconds` number
          - `eventType` 'collection_processing'
          - `collectionID` string, required — Unique identifier of the collection.
          - `collectionName` string, required — Name/path of the collection.
          - `operation` 'add' | 'update', required — The operation performed (add or update).
          - `processedCount` integer, required — Number of items successfully processed.
          - `collectionItemIDs` string[] — Array of collection item KSUIDs that were added or updated.
          - `status` 'success' | 'failed', required — Processing status (success or failed).
          - `errorMessage` string — Error message if processing failed.
        - object
          - `functionCallTryNumber` integer — The attempt number of the function call that created this event. 1 indexed.
          - `eventID` string, required — Unique ID generated by bem to identify the event.
          - `createdAt` string, date-time — Timestamp indicating when the event was created.
          - `referenceID` string, required — The unique ID you use internally to refer to this data point, propagated from the original function input.
          - `inboundEmail` EventInboundEmail
            - `to` string, required — The email address of the recipient.
            - `deliveredTo` string — The email address of the original intended recipient if the email itself was forwarded.
            - `from` string, required — The email address of the sender.
            - `subject` string, required — The subject of the email.
          - `metadata` object
            - `durationFunctionToEventSeconds` number
          - `eventType` 'send'
          - `functionCallID` string — Unique identifier of function call that this event is associated with.
          - `functionID` string, required — Unique identifier of function that this event is associated with.
          - `functionName` string, required — Unique name of function that this event is associated with.
          - `functionVersionNum` integer — Version number of function that this event is associated with.
          - `callID` string — Unique identifier of workflow call that this event is associated with.
          - `workflowID` string — Unique identifier of workflow that this event is associated with.
          - `workflowName` string — Name of workflow that this event is associated with.
          - `workflowVersionNum` integer — Version number of workflow that this event is associated with.
          - `deliveryStatus` 'success' | 'skip', required — Outcome of a Send function's delivery attempt.
          - `destinationType` 'webhook' | 's3' | 'google_drive', required — Destination type for a Send function.
          - `deliveredContent` object — The full protocol event JSON that was delivered — identical to what subscription publish would deliver for the same event. For ad-hoc calls with a JSON file input, contains the raw input JSON. For ad-hoc calls with a binary file input, contains {"s3URL": "<presigned-url>"}.
          - `webhookOutput` SendEventWebhookOutput — Metadata returned when a Send function delivers to a webhook.
            - `httpStatusCode` integer, required — HTTP status code returned by the webhook endpoint.
            - `httpResponseBody` string, required — Raw HTTP response body returned by the webhook endpoint.
          - `s3Output` SendEventS3Output — Metadata returned when a Send function delivers to an S3 bucket.
            - `bucketName` string, required — Name of the S3 bucket the payload was written to.
            - `key` string, required — Object key under which the payload was stored.
          - `googleDriveOutput` SendEventGoogleDriveOutput — Metadata returned when a Send function delivers to Google Drive.
            - `folderID` string, required — ID of the Google Drive folder the file was placed in.
            - `fileName` string, required — Name of the file created in Google Drive.
        - object
          - `functionCallTryNumber` integer — The attempt number of the function call that created this event. 1 indexed.
          - `eventID` string, required — Unique ID generated by bem to identify the event.
          - `createdAt` string, date-time — Timestamp indicating when the event was created.
          - `referenceID` string, required — The unique ID you use internally to refer to this data point, propagated from the original function input.
          - `inboundEmail` EventInboundEmail
            - `to` string, required — The email address of the recipient.
            - `deliveredTo` string — The email address of the original intended recipient if the email itself was forwarded.
            - `from` string, required — The email address of the sender.
            - `subject` string, required — The subject of the email.
          - `metadata` object
            - `durationFunctionToEventSeconds` number
          - `eventType` 'render'
          - `functionCallID` string — Unique identifier of function call that this event is associated with.
          - `functionID` string, required — Unique identifier of function that this event is associated with.
          - `functionName` string, required — Unique name of function that this event is associated with.
          - `functionVersionNum` integer — Version number of function that this event is associated with.
          - `callID` string — Unique identifier of workflow call that this event is associated with.
          - `workflowID` string — Unique identifier of workflow that this event is associated with.
          - `workflowName` string — Name of workflow that this event is associated with.
          - `workflowVersionNum` integer — Version number of workflow that this event is associated with.
          - `outputDownloadURL` string, required — Short-lived presigned HTTPS URL the recipient can GET to download the rendered docx. Bearer-token semantics: possession equals access. Treat as a credential — do not log full URLs or store beyond the delivery window. The URL expires after the platform-configured TTL; the next API serialization mints a fresh one.
          - `validationSeconds` number, double, required — Wall-clock seconds spent validating the upstream JSON against the doc-type schema.
          - `docxRenderSeconds` number, double, required — Wall-clock seconds spent generating the output docx through the template.
    - `errors` ErrorEvent[], required — Terminal error events of this call. Workflow calls are not atomic — `errors` and `outputs` may both be non-empty if some enclosed function calls succeeded and others failed. Retrieve individual errors via `GET /v3/errors/{eventID}`.
      - `functionCallTryNumber` integer — The attempt number of the function call that created this event. 1 indexed.
      - `eventID` string, required — Unique ID generated by bem to identify the event.
      - `createdAt` string, date-time — Timestamp indicating when the event was created.
      - `referenceID` string, required — The unique ID you use internally to refer to this data point, propagated from the original function input.
      - `inboundEmail` EventInboundEmail
        - `to` string, required — The email address of the recipient.
        - `deliveredTo` string — The email address of the original intended recipient if the email itself was forwarded.
        - `from` string, required — The email address of the sender.
        - `subject` string, required — The subject of the email.
      - `metadata` object
        - `durationFunctionToEventSeconds` number
      - `eventType` 'error'
      - `functionCallID` string — Unique identifier of function call that this event is associated with.
      - `functionID` string, required — Unique identifier of function that this event is associated with.
      - `functionName` string, required — Unique name of function that this event is associated with.
      - `functionVersionNum` integer — Version number of function that this event is associated with.
      - `callID` string — Unique identifier of workflow call that this event is associated with.
      - `workflowID` string — Unique identifier of workflow that this event is associated with.
      - `workflowName` string — Name of workflow that this event is associated with.
      - `workflowVersionNum` integer — Version number of workflow that this event is associated with.
      - `message` string, required — Error message.
      - `kind` string — Open, extensible error-kind label for typed transformation errors. The platform emits these as plain strings and the set grows over time, so clients must accept unknown values. For render functions the known kinds are `render_source_fetch`, `render_template_fetch`, `render_image_unresolved`, `render_validation`, `render_exception`, `render_upload`, and `render_contract`. Omitted for historical events that pre-date the kind column and for non-transform errors.
    - `input` FunctionCallCreateInputResponse
      - `singleFile` SingleFileInputResponse
        - `inputType` string — Input type of the file
        - `s3URL` string — Presigned S3 URL for the file
      - `batchFiles` BatchFilesInputResponse
        - `inputs` BatchFilesInputItemResponse[]
          - `inputType` string — Input type of the file
          - `itemReferenceID` string — Item reference ID
          - `s3URL` string — Presigned S3 URL for the file
    - `url` string, required — Hint URL for retrieving this call: `GET /v3/calls/{callID}`.
    - `traceUrl` string, required — Hint URL for the full execution trace: `GET /v3/calls/{callID}/trace`.
  - `error` string — Error message if the call retrieval failed, or if the call itself failed when using `wait=true`.

---

[API](https://skmtc.net/bem-team/apis/bem-api.md) · [All operations](https://skmtc.net/bem-team/apis/bem-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/bem-team/bem-api/versions/b0a6debb3458/schema)
