Temporal workflow design and development: when teams bring in a partner
Most teams keep business decisions and day-to-day code ownership in-house, and many bring in a partner for the initial workflow design, the retry and timeout model, and the test strategy. Those three decisions shape every workflow that follows, and they are hard to reverse once long-running executions depend on them. A process that spans minutes, days or a human approval usually breaks under cron jobs, queues or hand-built state because nothing durable records where the process stopped, what it already did and what it still owes. Temporal moves that state into the workflow itself, so the code describes the business process as a sequence of steps that can wait, retry and resume.
The split of work matters. Temporal SDK skills cover how a workflow is written: deterministic workflow code, activities that call external systems, signals, queries, child workflows and the test harness that replays history. Domain knowledge covers what the process must guarantee: which steps are compensable, how long an approval may wait, which failures are business outcomes rather than errors, and what a duplicate payment or notice would cost. Your own domain experts should own those answers, and a partner should translate them into workflow boundaries and timeouts that engineers can verify. Decide up front who signs off each timeout and each non-retryable error type.
The cluster hosting choice, whether you run self-hosted Temporal or use Temporal Cloud, is covered by sibling pages, not this one. Workflow design should not wait for that decision, but it should avoid assumptions tied to one hosting model. Ask for the design deliverables in writing: workflow and activity inventory, retry and timeout table per activity, idempotency keys for every side effect, and a test plan that includes replay tests before any code change reaches production.
What Temporal workflow design and development includes
The work turns a business process into a Temporal workflow with activities that handle side effects, explicit retry and timeout rules, and a test suite that proves the logic before it reaches production. Each component depends on the one before it, so the process map sets the boundaries that every other decision follows from. Scope, deliverables and timelines are agreed in writing before work starts.
Process mapping into workflow definitions
We map the business process step by step and decide which parts belong in workflow code and which belong in external systems. The workflow holds the orchestration state: what happens next, what waits, and what compensates on failure. Check that the map covers long waits, human approvals, and every point where the process can stop partway. Ask who owns each step after go-live, because that owner decides how the workflow is named, versioned and monitored.
Temporal deployment docsActivity design for side effects
Activities are the only place where calls to payment APIs, databases, email services or other external systems should happen, because Temporal may run them more than once after a worker crash or timeout. Design each activity so a repeated call is safe, usually by passing a stable business key that the downstream system can deduplicate on. Review each activity's inputs, outputs and failure modes before it is written.
Retry and timeout policies
Each activity needs its own retry policy and timeouts rather than inheriting defaults. Decide which errors are retryable, how many attempts a step may make, and how long a single attempt or the whole step may run. Separate errors that will never succeed, such as invalid input, from transient failures like a timeout on a downstream service. Record the chosen values in the design record so operations teams can explain why a workflow stalled.
Signal and query interfaces
Signals let outside systems or people change a running workflow, for example to approve a request or cancel a shipment. Queries let operators or services read workflow state without changing it. Define each signal and query as a documented contract with its payload shape, allowed states and who may send it. Confirm with the business owner which actions must be authorized, since Temporal's access controls depend on how the cluster is secured.
Child workflow boundaries
Child workflows split a large process into independently running parts with their own history, which keeps very long processes manageable and lets a sub-process be reused. The boundary decision matters: too many children add coordination overhead, while one oversized workflow grows its history on every step. Document where each boundary sits, what parent and child exchange, and how cancellation flows from parent to child.
Test suite and handover
The test suite uses the Temporal SDK test tooling to run workflows with mocked activities, simulate failures and timeouts, and check that signals produce the expected state. Tests should cover the retry paths and the edge cases found during process mapping. Deliverables include the reviewed workflow and activity code, a design record per workflow, the test suite, and a handover walkthrough so your engineers can extend the work. Confirm the exact SDK language and test tooling in the written scope.
How a workflow, its activities and retries move through Temporal
The diagram starts with a client starting a workflow, which the Temporal service records in workflow history. A worker polls the task queue, schedules an activity, and calls an external system with an idempotency key so retries do not repeat side effects. When an attempt fails, the retry policy and activity timeout decide the next attempt. A user signal reaches the running workflow, and a query reads its current state. Check the timeouts, retry settings and idempotency key first, because those choices control what happens when things fail.
Message flow for one workflow, including a retried activity, a signal and a query.
What drives Temporal workflow development cost and duration
This table lists the design choices that change how much work a Temporal workflow project takes and what it costs to run. Read each row as a lever: the first column names the driver, the middle column explains why it adds effort, and the last column shows how to keep it under control. The main takeaway is that standardizing workflow patterns early reduces both build time and the number of billable actions later.
| Driver | Why it raises effort or cost | How to keep it down |
|---|---|---|
| Number of business processes | Each process needs its own workflow definition, inputs, error handling, tests and operational runbook, so effort grows with the count. | Start with the few processes that have the most manual follow-up, and reuse shared activity libraries across them. |
| Activities per workflow | Every activity adds a task that may retry, time out and be counted as an action, which increases both testing and run cost. | Group small steps that always run together into one activity where idempotency allows, and keep activity counts reviewed in design. |
| External systems called | Each external API needs its own idempotent activity, credentials, timeout values and failure handling, and may need test doubles. | Wrap each external system once in a shared client with standard retry and timeout settings, then reuse it across workflows. |
| Long-running waits and human steps | Timers, signals and approval waits require durable state, reminder logic, escalation paths and tests for timing edge cases. | Define a single pattern for waits and approvals, and agree maximum wait durations and escalation rules before design starts. |
| Fan-out to child workflows | Child workflows multiply executions, history size and the paths that must be tested, and make failure propagation harder to reason about. | Limit nesting depth, use child workflows only where isolation or independent lifecycle is needed, and document the parent-child contract. |
| Existing code to migrate | Logic from cron jobs, queues or homegrown state machines needs mapping, parity testing and a plan for in-flight work. | Inventory existing jobs first, migrate the simplest flows, and confirm the cutover approach before writing new workflows. |
| Test coverage expected | Replay tests, activity failure tests, timeout tests and signal ordering tests add scope beyond ordinary unit tests. | Agree the test matrix in writing, use the Temporal test framework for time skipping, and automate replay checks in CI. |
| Compliance evidence needed | Audit trails, data handling rules for payloads, access records and change control evidence add documents and review steps. | Decide early which workflow inputs and outputs are sensitive, and plan payload encryption and retention with the compliance team. |
| Action-heavy design and run cost | Temporal Cloud pay-as-you-go pricing starts at 50 US dollars per million actions (Temporal pricing page), so frequent activities, timers and signals raise recurring cost. | Model expected action counts per workflow before build, and confirm with Temporal how each action type is counted for your design. |
How a Temporal workflow development project moves from design to release
The sequence turns a business process into a tested Temporal workflow, with each design decision recorded before code is written and each phase closed by a named output the client can review. It ends with a staged release to a non-production namespace and a handover the client's operations team can run.
Select processes and map boundaries
Your team and the DeployOpen engineers list the candidate processes, then pick the first workflows based on how long they run, how often they fail, and which external systems they touch. For each one, we map the boundary between what runs inside the workflow and what runs as activities against external systems. The output is a short scope document listing each workflow, its trigger, its end state, and the systems it calls. Confirm with us which processes are in the first release and who in your organization owns each business rule.
Review workflow and activity design
We draft the workflow and activity definitions, then review them with your architects and process owners. For each activity we record the retry policy, the start-to-close and schedule-to-close timeouts, and how the activity stays idempotent when it is retried, such as using a stable business key for external calls. Signals, queries, and child workflows are decided here as well. The output is a design record that lists each decision and its reason, signed off before implementation starts. Ask us to show how each external call behaves when it is retried.
Implement workflows and activities in the chosen SDK
Engineers build the workflows and activities in the Temporal SDK your team has chosen, keeping workflow code deterministic and moving all I/O into activities. Workers are configured with the task queues and concurrency settings from the design record. Code is delivered to your repository with a review history so your engineers can read every change. The output is a reviewed code branch that matches the design record line for line. Confirm the SDK language, your code review rules, and who approves merges before this phase starts.
Build the test suite for replay and failure cases
We write tests that run workflows through the SDK test environment, covering the happy path, activity failures, timeouts, retries that exhaust, signal arrival at unexpected points, and cancellation. Replay tests run recorded workflow histories against new code to catch nondeterministic changes before they reach a running cluster. The output is a test report listing each failure case, the expected behavior, and the test that proves it. Ask us which failure cases your business owners have agreed to, since those define what passing means.
Stage the release in a non-production namespace
The workflows are deployed to a non-production Temporal namespace on the cluster or Temporal Cloud namespace you plan to use, with worker versions matching the tested build. Test executions run against real integration endpoints or agreed test stand-ins, and we watch retries, timeouts, and visibility records during the run. Namespace access is limited to the roles defined in your authorization setup. The output is a staging record showing executions, failures, and the fixes applied. Confirm which environment is non-production, who signs off on promotion, and how production namespaces are separated.
Hand over with runbooks
We promote the approved build to production under the agreed change process, then hand the workflows to your operations team. Runbooks cover starting and stopping workers, reading workflow history, handling stuck or failed executions, rotating credentials used by activities, and deploying a new workflow version while old executions are still running. The output is the runbook set, a walkthrough recorded with your operators, and a list of open items. Confirm who receives the handover, what support is included after go-live, and whether ongoing support is handled as a retainer.
How retries, timeouts and idempotent activities shape the design
Retries are part of Temporal's default behavior, and that default shapes the design of every activity. When an activity fails, Temporal retries it under the activity's retry policy without any retry code written by the developer, so a failure is not the end of the workflow unless the policy says so. The team must decide, for each activity, how many attempts are acceptable, how long the backoff can grow, and which errors should stop retrying at once. Start-to-close timeouts bound a single attempt, while schedule-to-close timeouts bound the whole activity including every retry. An unbounded retry on a failing dependency can hold a workflow open for a long time, so both limits need explicit values. Errors that will never succeed on a second try, such as a rejected input or a missing account, should be classified as non-retryable in the activity code so the policy stops early. Confirm the exact retry and timeout fields in the current Temporal SDK documentation for your language.
Any activity that writes to an external system must be idempotent. An attempt can complete the external write and still fail before Temporal records the result, and the retry then runs the write again. The usual control is a business key, such as a payment ID or order number, generated by the workflow and passed into the activity, so the external system can recognize and ignore a duplicate. The activity should not generate its own key on each attempt, because a fresh key defeats the purpose. Workflow code has its own rule: it must be deterministic, so it must not call the network, read the clock, or generate random values directly, because Temporal replays the history to rebuild state. All I/O belongs in activities. For each activity, the partner should record the retry policy, the start-to-close and schedule-to-close values, the non-retryable error types, the business key source, the target system's duplicate handling, and the owner who approves any change to those settings.
How workflow design differs by process type
Short transactional sagas run a sequence of activities that each change an external system, such as reserving inventory, charging a payment and sending a confirmation. If a later step fails, the workflow runs compensating activities in reverse order to undo earlier steps. The design focus is the compensation logic: every forward activity needs a defined undo, and the undo must be safe to run more than once.
- Idempotent activities: Each activity should carry a business key, such as an order ID, so a retry after a timeout does not charge the customer twice.
- Retry policy per activity: Separate retryable errors, such as a timeout from a payment provider, from non-retryable errors, such as a declined card, so the saga does not retry what cannot succeed.
- Compensation ordering: Decide which compensations can fail themselves and whether they need their own retries or a manual queue.
- Timeouts at each step: Set start-to-close timeouts so a hung call moves the saga into compensation instead of stalling indefinitely.
- Testing: Use the Temporal test environment to simulate activity failures at each step and assert that the expected compensations run in order.
Check with your engineers which compensations cannot be reversed in the target systems, and agree how those cases are escalated.
Long-running processes wait for an external event or a human decision, such as a document approval that may take days or a customer who must upload identity documents. The workflow stays open while it waits, using signals to receive input and timers to enforce deadlines. The design focus is the state the workflow holds while it sleeps and how it behaves when the expected input never arrives.
- Signals as the input channel: Define each signal name and payload as a contract between the workflow and its callers, and document it for the teams that send them.
- Timers for deadlines: Pair every wait with a timer so escalation or expiry runs even when nobody responds.
- Queries for status: Expose read-only queries so dashboards and support staff can see the current state without changing it.
- Workflow code changes over time: A wait that lasts weeks will outlive several deployments, so plan a versioning approach before the first release.
- Testing: Use the test environment's time skipping to verify timer paths, and replay recorded histories against new code before deploying it to running executions.
Confirm who owns each signal and what happens when a signal arrives after the workflow has already completed.
Fan-out batch processing takes a large set of items, such as monthly statements for many accounts or document conversions, and processes them in parallel. The work is split either across child workflows, each owning a group of items, or across many activities scheduled from one parent. The design focus is controlling concurrency and making sure a partial failure does not silently lose items.
- Concurrency limits: Bound how many children or activities run at once so downstream systems are not overwhelmed and worker capacity is shared fairly.
- Child workflow boundaries: Split the batch into child workflows by a natural key, which keeps each history small and lets one failed group retry without restarting the rest.
- Result aggregation: Decide how the parent records successes, failures and skipped items, and make that summary the input to reconciliation.
- Event history growth: Very large batches can produce long histories, so use continue-as-new or smaller child groups instead of one unbounded workflow.
- Testing: Test with a realistic spread of failing items, including an empty batch, a single bad item and a batch with duplicates, and confirm the parent summary matches the input count.
Ask your team how the batch size is expected to grow, because that determines whether the child structure needs to change.
What goes wrong in Temporal workflow development and how to prevent it
Most Temporal production problems start in workflow and activity code rather than in the cluster. The cards below cover the mistakes that reviewers see most often, and each one names the check a design review or test suite should enforce before code reaches a worker.
Non-deterministic workflow code
Workflow code is replayed from its event history, so it must produce the same commands every time it runs. Reading the wall clock, generating random values, or calling the network directly inside a workflow breaks replay when the code runs again on a different worker. Use the SDK's deterministic time and random helpers, and move every external read into an activity. The design review should flag these calls, and a replay test against recorded histories should run in CI.
Deployment docsActivities without idempotency keys
Activities are retried after timeouts and worker failures, so a payment, email or ticket creation can run twice. Give each side-effecting call a business key derived from the workflow ID and step, and pass it to the downstream API so the target can deduplicate. Check each activity in review for a stable key and for behavior when the key already exists. Tests should invoke the same activity twice and assert that only one external effect occurs.
Default retry policies on non-repeatable calls
Temporal activities retry under the default policy unless the code sets one, which is unsafe for calls that cannot be repeated or that fail for permanent reasons. Set explicit timeouts and a retry policy per activity, list non-retryable error types, and keep the maximum attempts deliberate. The review should confirm that every activity states its timeouts and that validation errors are marked non-retryable so they fail fast instead of looping.
Unbounded signal and history growth
A workflow that loops forever, or that accepts signals without limit, accumulates event history until it becomes slow to load and replay. Plan for a fixed number of steps per run, use continue-as-new to start a fresh run with carried state, and cap how many signals are processed before rolling over. The design review should state the expected event count per execution, and tests should run a long-lived workflow past the rollover point.
Child workflow trees with no cap
Spawning a child workflow for each item in a large batch creates a tree that is hard to observe, cancel and keep within history limits. Bound the fan-out with a batch size, prefer a single child per batch or an activity for simple work, and set explicit parent close policies so children do not outlive their parent unintentionally. The review should record the maximum fan-out per parent and confirm the cancellation path.
Test suites that cover only the happy path
Tests that run a single successful flow miss timeouts, retries, signal ordering, cancellation and worker restarts, which are where workflows fail in production. Use the SDK test environment to simulate activity failures and timer firing, and add cases for duplicate signals and cancellation mid-activity. The test plan should list each failure branch, and a replay suite should run on every change to workflow code before deployment.
What recurring work follows Temporal workflow development
This table lists the work that continues after a Temporal workflow goes live, tied to the workflow and activity code your team owns. Each row names the recurring or one-time nature of the work, what triggers it, and the internal skill it needs. The main takeaway is that most of the ongoing effort sits in activity code, SDK currency and on-call for failed executions, not in the initial build.
| Work item | One-time or recurring | What drives it and internal skill needed |
|---|---|---|
| Maintaining activity code as external APIs change | Recurring | Partner API version changes, deprecations and schema updates. Needs engineers who own integration code and its error handling. |
| Updating the SDK version used by workers | Recurring | New SDK releases and server compatibility. Needs a team that can test workers in a staging namespace before rollout. |
| Adding tests for new process branches | Recurring | Each new business branch or signal needs replay and unit tests. Needs developers fluent in the SDK test framework. |
| Reviewing action volume and history size | Recurring | Growth in executions, fan-out from child workflows and long histories affect cost and performance. Needs someone who reads usage reports and workflow design. |
| On-call for failed or stuck workflows | Recurring | Non-retryable failures, timeouts and stuck signals need triage. Needs an on-call rota and runbooks covering the Temporal Web UI and CLI. |
| Initial workflow and activity design review | One-time | Defining determinism rules, retry policies and idempotency keys before first production use. Needs senior engineers with distributed systems experience. |
| Setting up replay testing in CI | One-time | A pipeline that replays recorded histories against new workflow code. Needs CI ownership and familiarity with workflow versioning. |
| Writing runbooks and failure playbooks | One-time, then updated | Initial documentation plus updates after each incident. Needs operations and workflow owners working together. |
| Pricing and usage review | Recurring | Temporal Cloud bills by actions and storage, with pay-as-you-go rates starting at 50 US dollars per million actions (Temporal pricing page). Confirm your own rate in the quote. |
What your team needs to provide before work starts
Design time for Temporal workflows is mostly spent finding out how the business process really works, so the most useful thing your team can provide is a named business owner for each process who can answer questions about exceptions, deadlines and who gets notified when something stalls. Alongside that owner, supply a written description of the current process or the existing code that runs it, including the steps that are done by hand today. Where a process has no written description, expect the first design sessions to be spent reconstructing it. Each undocumented exception that surfaces late usually means a workflow change, a new activity and another round of tests, so an early inventory of exceptions removes most of that rework.
Activities call your real systems, so the engagement needs access to target systems and test accounts for every external call the workflows will make, such as payment, CRM, identity or messaging APIs. Confirm in advance which of these systems offer a sandbox and whether test accounts can trigger real notifications or money movement. Your team should also decide the SDK language and where workers run, since that choice determines which libraries and build pipeline the workflow code uses and which network zone the workers can reach. Provide a non-production Temporal namespace for development and testing, and agree on the data classification for workflow payloads: workflow inputs and activity results are stored by the Temporal service, so the classification tells the designers which fields need to be kept out of payloads or protected with a codec. The Temporal deployment and persistence choices are decided in separate work, so this section only assumes that a development namespace exists.
Finally, name an internal owner who reviews code and approves releases. This person decides whether retry policies, timeouts and idempotency keys meet your operational standards, and signs off on what reaches production. Without one, review requests queue behind the design work and the first production release becomes the first real review. Ask the implementation partner to confirm in the written scope how many review cycles are included and who on your side must be available for each one. Confirm these inputs in writing before work starts, because each missing item moves the timeline and the cost of the design phase.
Questions buyers ask about Temporal workflow design and development
Can our in-house team design and build Temporal workflows without a partner?
Yes, many teams do, provided they have engineers who can reason about deterministic code, retries and failure modes. The harder part is rarely the SDK syntax. It is deciding which steps belong in a workflow, which belong in activities, and how each activity behaves when it runs twice. Teams that have not built a durable workflow before usually spend their early effort learning those trade-offs on production processes. A partner is most useful when the first workflows carry money, customer commitments or regulated records, and when the team needs a test plan and a review before go-live. Ask whether your engineers have already built one workflow end to end, including tests that replay history.
What drives the cost of a Temporal workflow project?
Cost is driven mostly by the number and complexity of the processes, not by Temporal itself. The main components are design of each business process, activity and error-handling logic, integration with existing systems, testing, and worker deployment. Hosting is a separate line: a self-hosted service needs databases, a visibility store and operators, while Temporal Cloud is billed on usage and support tier. Ask any quote to separate one-time build work from recurring items such as hosting, on-call coverage, upgrades and support. For hosting comparisons, the Temporal Cloud pricing page lists pay-as-you-go rates starting at 50 US dollars per million actions, and it lists support add-ons starting at 500 US dollars per month for the Business tier.
How long does it take to design and test a first workflow?
The duration depends on how well the process is understood before coding starts. Drivers include how many steps and external systems the process touches, whether the business rules are written down, how many compensation paths exist for failures, and how much human approval or signal handling is involved. Testing takes a meaningful share of the effort, because workflow tests should cover retries, timeouts, signals and replay against recorded histories. A first workflow usually takes longer than later ones, since the team also builds conventions for naming, error types and observability. Ask for a scoped plan that lists processes, acceptance tests and the decisions that must be made by your business owners.
What must our team provide before a Temporal engagement starts?
The engagement needs access and decisions more than code. Typically this includes:
- A named business owner for each process, who can confirm the rules, exception paths and acceptable failure outcomes.
- Read-only or sandbox access to the systems the activities will call, plus API documentation and test credentials.
- A target environment for workers and, if self-hosted, the infrastructure for the Temporal Service.
- Decisions on data classification, because workflow inputs and history may contain personal or regulated data.
- Access to your existing CI pipeline and code review process.
Confirm these items in writing before work starts, since missing access is one of the most common causes of schedule slip.
How are retries, timeouts and idempotency handled in Temporal?
Temporal retries activities according to a retry policy you configure, and it enforces timeouts such as start-to-close and schedule-to-close on each activity. Because an activity can run more than once after a worker crash or timeout, it must be idempotent. In practice, that means passing a stable idempotency key to downstream APIs, checking whether the side effect already happened before repeating it, and recording results in a store the workflow can read. Workflow code itself must be deterministic, so it should not call the clock, random numbers or external services directly. Non-retryable errors should be classified explicitly so that a rejected payment is not retried forever. Review each activity against these rules during design, not after an incident.
Can existing code be wrapped in Temporal, or does it have to be rewritten?
In most cases existing code can be wrapped. Functions that call services, databases or batch jobs can usually become activities with little change, as long as they can be made idempotent and their inputs and outputs are serializable. The orchestration logic that currently lives in cron jobs, queues or state tables is what usually needs redesign, because it has to become a deterministic workflow. Code with hidden global state, local file dependencies or long blocking calls needs more work. A short code review of the existing process, followed by a spike on one step, shows which parts are reusable before any rewrite decision is made.
What do we receive at handover of a Temporal workflow project?
At handover you should receive the workflow and activity code in your repository, automated tests including replay tests, worker configuration, and deployment manifests or infrastructure definitions for your environment. You should also receive design notes for each process covering retry policies, timeouts, compensation paths and signal or query contracts, plus a runbook for starting, stopping and inspecting workflows. Ask whether the handover includes operator training, observability dashboards and an explicit list of open risks. Confirm in the written scope which items are deliverables and which are left to your team.
Do we need to change workflow code later without breaking running executions?
Yes, and this should be designed in from the start. Running workflows replay their recorded history when a worker restarts, so code changes must remain compatible with that history. Temporal provides patching and versioning approaches for this, and replay tests catch incompatible changes before deployment. Teams should plan how old workers will be retired once no executions depend on them. Ask any partner how versioning will be tested and documented as part of the handover.
How DeployOpen scopes, builds and hands over Temporal workflows
DeployOpen approaches Temporal workflow design and development as a written, fixed-scope engagement inside your own infrastructure. We agree which processes, activities and tests are covered before work starts, then build, document and hand over the workflow code so your engineers can run it after go-live.
How we scope
- We list the business processes to move, with each step marked as a workflow, activity, timer or external call.
- We agree retry policies, timeout values and idempotency expectations for every activity that touches an external system.
- The written scope names the SDK language, the target Temporal environment and the deliverables before any code is written.
- Engagements are fixed-scope, and ongoing support and testing are available as a retainer after handover.
How we build
- We implement workflows and activities with signals, queries and child workflows only where the process design calls for them.
- Activities are built to be idempotent, using business keys so retries do not repeat payments, messages or record changes.
- We write replay and unit tests for workflow logic, so changes can be checked against recorded histories before release.
- Workflow code is reviewed against your security and data handling rules, including how payloads are stored and who can read them.
How we hand over
- You receive the workflow and activity source code, test suite and a runbook covering starts, retries and failure handling.
- Documentation records each workflow's timeouts, retry settings, signals, queries and the data each activity reads and writes.
- We walk your engineers through the code and operational procedures so the owning team can change workflows safely.
- We confirm with your team which Temporal SDK version, server version and namespace the handover is tested against.
How we support
- Support covers defect fixes, questions about workflow behavior and review of planned changes to running workflow code.
- Retainers can include test updates when SDK or Temporal Server versions change, so workflows keep passing their checks.
- Clients should confirm response expectations, change request handling and included hours in the written support terms before go-live.

