Substructure vs. Temporal for AI agents

Checked August 7, 2026

Temporal is for teams whose whole system needs to survive failure: you write workflow code, it records every step, and after a crash it replays the record and continues. Substructure is for teams who want the agent: config in git, running in Slack, with every step of the loop open to your code.

Both save every step. The question is what you build before your team has an agent it can use.

Use Temporal whenUse Substructure when
Agents are one of many durable workflowsThe agent is the product
You already operate TemporalYou do not want a cluster or a worker fleet
The loop should be your own codeYou want to own some steps, not the platform

What Substructure does that Temporal does not

  • Gives you the agent. Temporal's own AI solutions page draws the line: they handle failures, state, and scale, and you build the AI logic, the workflow definitions, the tool integrations, and the model calls.
  • Answers in Slack from the config file. On Temporal, the chat surface is yours.
  • Puts no rules on your code. Workflow code must be deterministic: no clocks, no randomness, no direct I/O, and the Python SDK sandboxes your code to enforce it.
  • Deploys whenever you like. Changing workflow code during open executions is a versioning event you manage with patching or worker versioning.
  • Charges nothing per step. Temporal Cloud meters Actions at $50 per million: every activity, retry, timer, signal, and query. An agent loop is chatty.

Side by side

Building the agent

TemporalSubstructure
What you getDurable executionA running agent
The agent loopYou write itThe engine runs it
Your codeWorkflows and activities in an SDKA stateless HTTP endpoint
Constraint on your codeMust be deterministicNone
LanguageEight official SDKsAny language, over HTTP

Running it

TemporalSubstructure
DurabilityReplay from an event historyEvery step, before it runs
Deploying a changePatching or worker versioningDeploy when you like
Self-hostFour services plus a database, and a worker fleetOne binary and SQLite
Proven scaleVery largeNot aiming at that ceiling

Surfaces and price

TemporalSubstructure
SlackYours to buildOne command
Chat historyYours to buildIn the engine
StreamingWorkflow Streams, in previewAG-UI, native
MCP authYoursThe engine's
PriceMetered ActionsFlat, bring your own key

What you write

workflow.py
@workflow.defn
class OnCall:
    @workflow.run
    async def run(self, question: str) -> str:
        return await workflow.execute_activity(
            call_model, question, start_to_close_timeout=timedelta(minutes=5)
        )
subs.toml
[llm.openrouter]
type = "openrouter"

[mcp.sentry]
url = "https://mcp.sentry.dev/mcp"

[agent.oncall]
llm = "openrouter"
model = "moonshotai/kimi-k3"
system = "You are the on-call assistant."
mcp = ["sentry"]

[agent.oncall.slack]
name = "Oncall"

The workflow is one activity of an agent you still have to build. The file is the whole agent: subs apply, and it answers in Slack.

Where Temporal is the better choice

  • Close to a decade of production hardening, at a scale a single-binary engine is not aiming at.
  • Eight official SDKs and enterprise SLAs.
  • One platform for payments, provisioning, ETL, and agents together.
  • Full control of the loop as your own code, if that is what you want.

Questions

Is Substructure durable enough? Every trigger, decision, and call is saved before it runs, and a restarted engine continues from the last step.

Can I keep Temporal underneath? Yes. A worker can start a Temporal workflow for the parts that need it.

What happens when I redeploy my code? Nothing. Your worker holds no state between calls, so there is no versioning event.

The quick start takes about five minutes.