Skip to main content

Creating or Resuming a Thread

A thread is one workflow execution, such as an order, support ticket or customer onboarding. Its steps form an execution graph across every participating service. Use the application’s durable process key to recover the same thread in later requests. A new key creates a thread; a closed key rejects further writes. See resume across requests.

Recording Steps

Always create the step before executing business logic:

Step Methods

Non-contract threads remain “active” indefinitely unless explicitly ended. View Closing a Thread
An acknowledgement means the event was recorded, not that asynchronous contract validation has passed. Use .success(message, { waitFor: true }) for the exact validation result, or call thread.waitFor(stepName) before the business operation. See execution waits.

Idempotency

Threadify stores only the first recording for an idempotency key. See Idempotency when retries need a custom key.