FabricFabricHarness
Deployment

Temporal Worker

Run agent sessions as durable Temporal workflows.

The Temporal worker target turns sessions into durable Temporal workflows: prompts become signals, tool calls become activities, child tasks become child workflows, approvals become signal waits.

Build the worker artifact

fh build --target temporal-worker

Output:

.fabricharness/build/temporal-worker/
  dist/worker.mjs
  manifest.json
  README.temporal-worker.md

Run the worker

You can run the prebuilt artifact:

node .fabricharness/build/temporal-worker/dist/worker.mjs

Or run a worker against the live workspace (great for development):

fh temporal-worker --task-queue fabric-harness --address localhost:7233

Drive an agent on the worker

fh run ask --target temporal-worker --id ask-001 --prompt "What is Temporal?"

The CLI:

  1. Connects to Temporal,
  2. Starts (or resumes) the session workflow with id ask-001,
  3. Signals it with the prompt,
  4. Streams output back.

Workflow model

graph LR
    A[AgentSessionWorkflow] --> M[ModelCallActivity]
    A --> T[ToolExecutionActivity]
    A --> S[SandboxCommandActivity]
    A --> V[ResultValidationActivity]
    A --> C[CompactionActivity]
    A --> CT[Child Task Workflow]
    CT --> M
    CT --> T

Configuration

.fabricharness/config.ts:

export default {
  temporal: {
    address: 'localhost:7233',
    taskQueue: 'fabric-harness',
    namespace: 'default',
    workflowIdPrefix: 'fabric',
    promptWorkflowMode: 'hybrid',
    apiKeyEnv: 'TEMPORAL_API_KEY',     // for Temporal Cloud
    tls: { /* ... */ },
  },
};

Environment overrides:

VariablePurpose
FABRIC_TEMPORAL_ADDRESShost:port
FABRIC_TEMPORAL_TASK_QUEUEtask queue name
FABRIC_TEMPORAL_NAMESPACEnamespace

Temporal Cloud

Set address to your Temporal Cloud endpoint, configure mTLS or API key, and the worker connects normally:

export default {
  temporal: {
    address: 'my-namespace.tmprl.cloud:7233',
    namespace: 'my-namespace',
    apiKeyEnv: 'TEMPORAL_API_KEY',
    tls: { serverName: 'my-namespace.tmprl.cloud' },
  },
};

Operational notes

  • Workers are stateless. Run several behind your task queue for throughput.
  • Approval waits are signal-driven and consume no worker time.
  • Use Temporal's UI or temporal workflow show to inspect history independently of fh inspect.
  • Live model + Temporal tests are opt-in in CI; treat real workflow execution like any other production workload.