Trama

Saga and Workflow Runtime

Distributed workflow orchestration without platform overhead.

Define linear sagas or branching node graphs, execute them through a simple HTTP API, and let Trama handle retries, compensation, async callbacks, and execution state.

Trama coordinates distributed workflows while keeping services focused on business logic. No SDKs. No framework integration. No platform migration required.

Read the Docs

Comparison

Orchestration without chaos

Distributed workflows become hard to reason about when orchestration logic lives inside individual services.

Hand-rolled orchestration

  • Logic spread across multiple services
  • Retry and rollback behavior implemented inconsistently
  • Compensation flows duplicated across teams
  • Execution state buried in logs
  • Hard to reconstruct failures across service boundaries
  • No single place to inspect workflow progress
  • Operational visibility depends on custom tooling

With Trama

  • Dedicated runtime for saga and workflow orchestration
  • Linear and node-graph definitions in the same runtime
  • Branching at runtime via switch nodes and JSON Logic
  • Async task coordination with signed callback tokens
  • Consistent retry and compensation policies
  • Durable execution state persisted by the runtime
  • Clear step-by-step execution history
  • API to inspect and debug running workflows
  • Built-in metrics and tracing
  • No SDK or framework integration required
  • Adoption requires only HTTP integration

Trama sits between hand-rolled orchestration and full workflow platforms, without requiring a platform adoption project.

Async execution flow

Client Trama Service (202) Trama waits Callback received Execution resumes

Trama injects a callback URL into async requests and resumes execution when the callback is received.

Execution Walkthrough

Watch Trama coordinate a branching workflow

A stored workflow definition is created, execution starts, a switch node evaluates the payload and picks a branch, the selected branch fires an async task, execution pauses waiting for a callback, the callback resumes it, and the workflow completes.

The same execution model works with any service that can receive HTTP requests.

  1. 1
    1. Create stored definition Persist the reusable workflow definition before any run starts.
    idle
  2. 2
    2. Run stored workflow Create an execution from the stored definition and input payload.
    idle
  3. 3
    3. Evaluate switch (branch decision) Trama evaluates the JSON Logic expression and picks the matching branch.
    idle
  4. 4
    4. Execute selected branch The pix-payment async task node dispatches its request to the external service.
    idle
  5. 5
    5. Async step returns 202 The service accepts the request asynchronously. Trama pauses the execution.
    idle
  6. 6
    6. Wait for callback Execution status is WAITING. The runtime holds state until the callback arrives.
    idle
  7. 7
    7. Callback resumes execution The external service POSTs back with a signed token. Trama validates and re-enqueues.
    idle
  8. 8
    8. Workflow completes successfully The final result is stored and inspectable through the API.
    idle
executionId: 9c7a1f2e-3db0-4e4b-9c5e-2f8b6d5c1a77 status: READY currentStep: definition-stored
Request

Event log

    What this shows

    Trama evaluates the switch node, routes to the pix branch, pauses on the async step, validates the callback token, resumes execution from the next node, and stores the completed state through the API.

    Architecture

    Runtime model

    Client Trama HTTP API Execution Store Queue Workers Node handlers Services
    Services Callback receiver Queue Resume

    Task nodes call services. Switch nodes choose execution paths. Async nodes pause and resume through callbacks. Sleep nodes pause execution for a set duration.

    Trama separates orchestration from execution. The API stores execution state and enqueues work before handing it to workers. Workers dispatch each node to the appropriate handler — task nodes make HTTP calls, switch nodes evaluate JSON Logic expressions and route to the next node.

    Async task nodes pause execution and wait. When the external service calls back with a signed token, the callback receiver validates and re-enqueues the execution to resume.

    Trama integrates through HTTP and does not require changes to existing services.

    Explore the full architecture guide

    Capabilities

    Runtime capabilities

    Trama provides the primitives required to safely coordinate distributed workflows in production.

    Linear and branching execution

    Execute both sequential flows and conditional workflows using switch nodes.

    Async callback coordination

    Pause execution on async steps and resume via signed callbacks (or timeout).

    Failure-aware runtime

    Built-in retry and compensation handling across all workflow steps.

    Dynamic request templating

    Inject payload and step results into HTTP requests using templates.

    "orderId": "{{payload.orderId}}"
    "reservationId": "{{nodes.reserve.response.body.id}}"

    Durable execution state

    Persist execution state and inspect workflow progress through the API.

    Observability primitives

    Expose metrics and traces for workflow execution, failures, and callbacks.

    API-first orchestration

    Trama exposes an HTTP API and OpenAPI contract. Workflows can be triggered and inspected from any language or platform. No SDK, framework integration, or platform migration is required.

    Visual management UI

    Inspect executions, debug step-by-step with Gantt timelines, and create or edit definitions with a built-in graph editor. Explore the UI

    Comparison

    Most teams do not need a full workflow platform.

    There are three common approaches to distributed workflows.

    Approach How it works Tradeoff
    Hand-rolled orchestration Workflow logic spread across services with inconsistent retry and rollback behavior. Fast to start, difficult to maintain as workflows grow.
    Trama Dedicated workflow runtime. Linear sagas, branching node graphs, and async task coordination through a simple HTTP API. Centralizes workflow coordination without turning it into a platform project.
    Heavy workflow engines Powerful orchestration platforms designed for complex workflow management and platform-level automation. Broader capabilities, but more operational and adoption overhead.

    Use Cases

    Typical use cases

    Order processing

    reserve inventory route to payment method async payment authorization create shipment compensate on failure

    Financial workflows

    async authorize transaction branch on authorization result execute settlement record ledger entry notify on completion or failure

    Operational pipelines

    trigger multi-service data flow branch on upstream result retry on transient failures compensate partial completions inspect full execution history