DocsOpen Workflows

Get started

Your first workflow

Write a workflow that sorts incoming support tickets, upload it, start a run with an API key and read what it decided.

1Write the workflow

A workflow is a YAML file: the request it accepts, the steps it runs and what it returns. This one asks the model to read a ticket and return a fixed shape, so whatever starts it can rely on the answer.

triage.yaml
Workflow: TriageTicket
Description: Reads a support ticket and says what it is about and how urgent it is.
Triggers:
  - New: Ticket
    Schema:
      type: object
      required: [Prompt]
      properties:
        Prompt: { type: string }
Output:
  Structured:
    type: object
    required: [Topic, Urgency]
    properties:
      Topic: { type: string, enum: [Billing, Refund, Bug, Account, Other] }
      Urgency: { type: string, enum: [Low, Normal, High] }
Steps:
  - ModelCall: Triage
    Instructions: Read the ticket. Say what it is about and how urgent it is.
    Output:
      Structured:
        type: object
        required: [Topic, Urgency]
        properties:
          Topic: { type: string, enum: [Billing, Refund, Bug, Account, Other] }
          Urgency: { type: string, enum: [Low, Normal, High] }
ModelAsk the model
Step kind
ModelCall
Name
Triage
Model
Auto
Output
Structured
The one step. With no Model of its own, and none on the workflow, it asks for auto and runs on the models the organization lists in Settings › Models, tried in order.

2Upload it

Send the YAML as the request body with an API key of your Workflow organization, created in Settings › API keys and shown once. Momor compiles it before storing anything: a workflow that fails is refused with 422 and one line per problem, giving the line, column and field. A workflow that passes comes back with its id and the content hash of this version; keep the id to start runs on it.

curl -X POST "https://api.momor.ai/workflow/workflows" \
  -H "Authorization: Bearer $MOMOR_API_KEY" \
  -H "Content-Type: application/yaml" \
  --data-binary @triage.yaml

You can also save it in Workflows: choose Start from nothing, switch the editor to YAML, paste the file and choose Save version. No Workflow organization yet? Create one.

3Start a run

Start a run on the workflow with the same key and send the ticket in the same request. The body is checked against the Ticket schema; when it passes, the run opens its first turn and Momor answers 202 with that turn while the steps run.

curl -X POST "https://api.momor.ai/workflow/workflows/$WORKFLOW_ID/runs" \
  -H "Authorization: Bearer $MOMOR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "Prompt": "I was charged twice for my October invoice." }'

4Follow the run

Ask for the same request as an event stream and the response follows the turn to its end instead: an opened frame, every event the turn records, then closed. The answer is in the result.committed event.

curl -N -X POST "https://api.momor.ai/workflow/workflows/$WORKFLOW_ID/runs" \
  -H "Authorization: Bearer $MOMOR_API_KEY" \
  -H "Accept: text/event-stream" \
  -H "Content-Type: application/json" \
  -d '{ "Prompt": "I was charged twice for my October invoice." }'
Read it again laterEvery run keeps its record. GET /workflow/runs/{runId} returns the run and its turns, and the same address as an event stream replays every event from the start. See Run history.

Next

Updated Oct 22, 2026
Esc