Temporal Signal-With-Start for create-or-update flows

Signal-With-Start sends a signal to a workflow and starts that workflow if it does not exist, in one request. This page covers when teams need it, how to configure and secure it, and what to confirm before building.

On this page

Temporal Signal-With-Start for create-or-update flows: what it solves

Signal-With-Start sends a signal to a workflow and starts that workflow if it does not already exist, in one call. That matters when a message can reach your system before the workflow for its entity exists, such as an item added to a cart before the cart workflow has been created, a request that touches a session before the session workflow is up, or an event for a customer account that has no workflow yet. Without it, the calling code has to check whether the workflow is running, start it if not, and then signal it. Two concurrent callers can both see that the workflow is missing, both try to start it, and the second start fails or the signal lands in the wrong place. Signal-With-Start removes that gap because the start and the signal are handled together on the server side.

Teams most often reach for it in three situations: carts and other shopping state where many events arrive for one customer over time, sessions that are created by the first request and extended by later ones, and per-entity workflows where each account, subscription or device has its own long-running workflow. In each case, the workflow ID should map to the business key (for example, a cart or account identifier), and the team must decide how duplicate IDs and reuse policies behave when a workflow has already completed. If the message is only ever meant to start work, a plain start is simpler. If the caller needs a validated answer back from a running workflow, a Temporal Update is the better fit, and the two can be combined where the workflow also needs to accept state changes.

Before you adopt the pattern, confirm three points against the Temporal documentation for the SDK and server version you run. First, check how the start options interact with your workflow ID reuse policy and conflict policy, since these decide whether a signal to a closed workflow starts a new run or is rejected. Second, check which signal and start parameters the SDK exposes, and make sure the signal handler, the workflow's initial input and any default state are consistent, so a workflow started by a signal sees the same data as one started normally. Third, check how your workflow code handles a signal that arrives before the workflow has run its first line, because handlers and initialization order determine whether early messages are kept or lost. Replay tests should cover both the start-by-signal path and the normal start path.

The design work is mostly about the business key and the lifetime of the workflow. An illustrative example: a cart workflow keyed by customer ID receives item events from several channels, starts on the first event and completes after checkout, so a later event for the same customer should begin a new cart rather than fail. Decide in advance who owns the key, how long idle entity workflows stay open, and whether they need Continue-As-New to bound history. Those choices, not the API call itself, determine whether the pattern holds up in production.

How a Signal-With-Start request flows through the Temporal Service

The request starts at the client, which sends one Signal-With-Start call carrying a workflow ID and the signal payload. The Temporal Frontend checks whether an open run exists for that ID. If one is open, the signal is delivered to the running workflow; if not, a new run starts and receives the signal as its first event. A closed workflow follows the branch set by the WorkflowIdReusePolicy, which decides whether a new run may start. Either way, a worker on the task queue then processes the signal in workflow code.

Signal-With-Start branches on whether an open or closed run exists for the workflow ID.

Configuration choices and when each fits

This table compares the decisions that shape a Signal-With-Start design: how the workflow ID is built, how closed workflows are handled, the signal contract, start options and the choice between Signal-With-Start and a separate start plus signal. Read each row as a question to settle before the first workflow ships, and note what breaks if the choice is wrong.

DecisionChoose whenWhat breaks if chosen wrongly
Workflow ID scheme (per cart, per session, per entity)One ID per business object that needs a single running workflow, such as a cart or session key that already exists in your domainUsing a random or per-request ID creates a new workflow on every call, so the signal never reaches the workflow that holds the state
Workflow ID reuse policy for closed workflowsThe object can be created again after it finishes, so a new run with the same ID is expectedIf reuse is blocked, starts for a finished object fail; if reuse is allowed for objects that must stay unique, a duplicate lifecycle can begin unnoticed
Signal name and payload shapeSignals carry a small, versioned message with explicit fields and a type that the workflow handles in one placeRenaming a signal or changing its payload shape while old workflows still run can drop messages or fail decoding; keep old handlers until those runs close
Start options: task queue and timeoutsThe task queue names the worker pool that owns the workflow code, and timeouts match how long one run may lastA task queue with no workers leaves the started workflow waiting; a run timeout shorter than the expected lifetime ends live carts or sessions early
Signal-With-Start versus plain start plus signalUse Signal-With-Start when the caller does not know whether the workflow exists and must not race a separate start callA plain start followed by a signal can fail when the start is slow or retried, and a signal sent before the run exists can be rejected
Who owns the workflow ID namespaceOne service owns ID construction so every caller builds the same key from the same source fieldsTwo services that format the same key differently (case, prefixes, separators) create two workflows for one entity
Behavior when the workflow is already runningThe workflow treats a repeated start-with-signal as an update to its state and ignores duplicatesWorkflow code that assumes it is always new will repeat side effects on each signal, which is harder to undo later

How to set up a create-or-update flow on Temporal

This sequence takes a team from a stable business key to a verified Signal-With-Start path, so that one call either starts a workflow for an entity or delivers a signal to the workflow already running for it. Each step ends with a check the reader can run before moving on.

  1. Confirm the namespace and worker dependencies

    Before any client call, the platform team confirms that the Temporal namespace exists on the service the application will use, whether that is a self-hosted Temporal Service or Temporal Cloud, and that the namespace's retention and access settings match the team's design. The application team confirms that workers can reach the frontend and that the worker deployment is planned for the task queue named in the next steps. Done means a test client can connect to the namespace and describe it, and the team has a named owner for the worker deployment. Ask the platform owner which authentication method the namespace uses, since self-hosted deployments with no Authorizer configured accept every API request.

  2. Define the workflow ID format

    Write down the business key that identifies the entity, such as a cart ID, session ID or account ID, and build the workflow ID from it with a fixed prefix, for example cart- followed by the key. The key must be stable for the life of the entity and must be known to every caller that might send a signal. Reviewers check that no field that changes, such as a timestamp or a random value, appears in the ID. Done means a short ID specification exists, and a test script produces the same ID from two different callers for the same entity.

  3. Write the workflow that handles first run and running cases

    The developer writes the workflow function so it initializes state when it starts and then loops on a signal handler that applies each message to that state. The signal handler should accept the payload that describes the change and should be safe to call before the workflow has finished its startup steps. Design the workflow to end, or to use Continue-As-New, when the entity is no longer active, and document that decision. Done means unit tests with the Temporal SDK test environment pass for a first start followed by two signals, and the handler produces the expected state each time.

  4. Choose the task queue and deploy workers that poll it

    The team names one task queue for the workflow and its activities, documents the worker build and version used to run it, and deploys workers that poll that queue in the namespace. Workers must be running before the first Signal-With-Start call, because the first run is only scheduled and executed when a poller picks it up. Operations confirms that the worker can reach the frontend and logs its polling activity. Done means a worker process reports that it is polling the queue, and a manually started test workflow completes on it.

  5. Call Signal-With-Start from the client with the same ID

    The client code calls Signal-With-Start with the workflow ID from step two, the workflow type, the task queue, and the signal name and payload. Because the same call both starts and signals, the caller does not check whether the workflow exists first. The developer confirms that the call returns the run ID for the workflow and that the same request sent twice produces one running workflow. Done means a client script sends the first message, sees the workflow start, then sends a second message and sees the signal delivered to the same run.

  6. Test the duplicate path

    The QA or engineering owner sends the same Signal-With-Start request several times in sequence and checks the namespace for duplicate running workflows with the same ID. They also confirm that each signal changed state as the workflow code expects, and that the signal handler does not fail when the payload repeats an earlier change. Done means the workflow list in the Web UI or CLI shows one running execution for the ID, and the final state reflects every message exactly once.

  7. Test the concurrent and closed-workflow paths

    The team fires simultaneous Signal-With-Start calls for one new key and checks that exactly one workflow starts and that all signals are delivered to it. Then they close the workflow, for example by completing it, and send another signal with the same ID to see how the service responds and whether the call starts a new run under the documented reuse policy. Reviewers confirm that the reuse and conflict policies match the design in step two. Done means the test log records the outcome of each concurrent call and the closed-workflow behavior, and the team has written down the expected result for each.

How the pattern changes for carts, sessions and entities

A cart workflow is usually keyed by a cart or shopping session identifier, so the first add-to-cart event can create the workflow and later events reach the same run. The workflow is short-lived and exists to hold pending items, apply pricing rules and wait for checkout or abandonment. Its design depends on how much state must survive between events and how long a shopper may leave a cart idle.

  • Business key: use the cart ID issued at first interaction, not the customer ID, so a guest cart and a later login do not collide.
  • First signal: the add-item signal carries the item, quantity and price snapshot; the workflow records it as the initial state.
  • Lifetime: set an explicit idle window in the workflow and end it when the cart expires or checkout completes.
  • Settlement before end: release any inventory holds and record the abandonment or order outcome before the workflow returns.
  • Illustrative check: a shopper adding two items within a second should end with one cart run holding both, not two runs.

Confirm with your team how the cart ID is issued and how guest carts merge into account carts.

What to confirm about limits before you build

Signal-With-Start creates a workflow the first time a message arrives and delivers the message to it afterward, which makes the workflow's lifetime and identity central to the design. The cards below cover the limits and behaviors that shape that design, and each one should be checked against the Temporal documentation for the server version and SDK you plan to run.

Workflow history growth

Every signal received by a long-lived per-entity workflow adds events to its history. Cart, session and entity workflows often stay open for days or longer, so history grows with each update. Confirm the history size and event count limits for your server version, decide how the workflow will bound its history, and confirm how Continue-As-New interacts with the signals that arrive during the handoff. Confirm the history ceiling before modeling a long-lived entity.

Temporal deployment docs

ID reuse for closed workflows

Signal-With-Start targets a workflow ID, so what happens when a workflow with that ID has already closed decides whether a returning cart or session starts a fresh run or fails. Check the workflow ID reuse policy and the conflict policy in your SDK, and confirm which states count as open or closed. Decide whether IDs are derived from a stable business key, and test what a customer returning after a completed session will encounter.

Signal payload size

Each signal payload is recorded in workflow history, so large payloads inflate history and slow replay. Confirm the maximum payload and blob size limits for your server version and SDK, and check whether your payload encryption codec changes the encoded size. Keep signal content small, such as an identifier or a delta, and store large content in an external system referenced by ID.

Idempotent handling of retried signals

A client that times out on a Signal-With-Start call may retry it, and the workflow may receive the same change twice. Design each signal with a unique identifier and make the handler ignore identifiers it has already applied, and store that set in workflow state so it survives Continue-As-New. Test duplicate delivery explicitly, because the workflow will not detect it on its own.

SDK method names and options

The method that combines start and signal, and the options that control workflow ID reuse, conflict handling and retries, differ by language SDK and may change between releases. Confirm the exact method name, its parameters and its return values in the SDK you use, and check the minimum SDK version that supports it. Pin the SDK version in your build and add an integration test that exercises the call against your target server version.

Server version and feature support

Server-side behavior for start and signal combinations can differ across minor versions, so the server version in your environment matters as much as the SDK. Plan the upgrade path one minor version at a time, confirm the behavior in the release notes for each step, and rerun the start and signal tests after every upgrade. Confirm the target version against the Temporal GitHub releases before choosing a baseline.

Upgrade server docs

Questions teams ask before building Signal-With-Start flows

What does a Signal-With-Start build cost and what drives the effort?

The cost depends on how many entity types need the pattern, how much business logic each signal handler carries, and how many systems the workflow must call. A single flow with a few signal types and a small set of activities is far smaller than a platform-wide pattern shared by several services. Effort also rises with idempotency rules for duplicate messages, the input payload design, and the test harness needed to prove that concurrent sends still reach one workflow. DeployOpen does not publish a price list. Ask for a fixed-scope written quote that lists the entity types, signal types, integrations, test cases and handover deliverables, so you can compare it against your own team's estimate line by line.

How long does a first Signal-With-Start flow take to design and test?

The first flow usually takes longer than later ones because the design choices are new to the team: the workflow ID scheme, what the start input contains, which signals update state, and how the workflow ends or continues. Testing covers replay of the workflow code, concurrent sends to the same ID, and behavior when a worker restarts mid-flow. The written scope should state the milestones and the review points rather than a guessed duration, so ask the team to show the test plan and the list of decisions that must be signed off before build starts.

What does the internal team need to provide during the engagement?

Your team needs to supply the business rules that decide what a signal changes, the identifiers that map to each entity, and an owner who can answer questions about edge cases such as a cart that is already checked out. Engineers should provide access to a non-production Temporal environment, the codebase where the client calls live, and a named reviewer for workflow code. Security and platform staff should confirm where the Temporal Service runs and which namespaces and access controls apply. List these inputs in the quote so the dependency on your people is visible before work starts.

Can our own engineers build a Signal-With-Start flow without outside help?

Yes, a team with Temporal SDK experience can build the pattern, and the official documentation describes the start and signal behavior in enough detail to start. The hard parts are less about the API call and more about determinism, versioning of workflow code that is already running, and testing replay so a later change does not break open executions. Teams with no prior Temporal work often benefit from a short design review before the first build. DeployOpen can take on the whole flow, a design review, or the test and hardening work, and the choice should follow from where your team's gaps are.

Is a plain start followed by a signal enough for our use case?

It often is not, because a client that starts a workflow and then sends a signal makes two calls, and a failure between them or a concurrent request can start the workflow twice or send the signal to a workflow that does not exist yet. Signal-With-Start combines both steps into one operation on the same workflow ID, which removes that window. If your flow only ever starts a workflow once at a known moment, a plain start may be enough. Confirm the behavior against the current Temporal documentation for your SDK version and test the race explicitly, because the answer depends on how your callers retry.

What changes if the entity workflow must run for years?

A workflow that lives for years needs a plan for history growth, versioning of its code and retention of its state. Long-running workflows should carry bounded state and use Continue-As-New when history grows, and every code change must stay compatible with executions already running. Operations also need to account for the Temporal Service's storage and visibility components over that period, along with upgrades that must follow the documented one-minor-version-at-a-time path. Ask the quote to cover versioning rules, a Continue-As-New approach, and an upgrade runbook, since these work items are what turns a short build into a multi-year operating commitment.

Who is responsible for the Temporal platform after the flow goes live?

Responsibility depends on whether you self-host the Temporal Service or use Temporal Cloud. Self-hosted deployments put the server, persistence, visibility, upgrades and access controls on your team or on a support retainer, while Temporal Cloud moves the service operation to Temporal Technologies and leaves the worker code and its deployment with you. The written scope should name which parts DeployOpen covers, which your team keeps, and which retainer options apply after handover. Ask for the ownership split in writing so the on-call duties are clear before go-live.

Security and operational controls for signal-driven workflows

Signal-With-Start creates a workflow the first time a signal arrives, so anyone who can reach the API can create state as well as change it. The cards below cover the access, transport, payload and network controls that decide who can start and signal workflows, and the monitoring that shows when a start or signal was not what you intended.

Configure an Authorizer explicitly

If no Authorizer is configured, self-hosted Temporal uses the default noopAuthorizer, which allows every API request with no authentication or access control. A Signal-With-Start call from an unintended caller can therefore create a workflow and deliver data to it. Before any cart, session or entity workflow goes live, confirm which Authorizer is active in your configuration and test that an unauthorized caller is refused.

Temporal security docs

Map namespace roles from claims

Self-hosted Temporal provides a ClaimMapper that maps JWT or certificate claims to namespace roles. Use it so that the service identity that sends Signal-With-Start calls holds write access only to the namespace that owns those workflows, and read-only or no access elsewhere. Check the mapping with a token from each client type, because a broad role granted for convenience during development often survives into production.

Enforce mTLS between services

Self-hosted Temporal supports mTLS with separate settings for internode traffic and frontend traffic. Frontend settings protect the path from your application workers and clients to the Temporal Frontend, while internode settings protect traffic between Temporal services. Confirm that both are enabled, that certificates rotate on a schedule you can operate, and that clients without a valid certificate are rejected.

Encrypt signal payloads with a codec

Signal arguments are stored in workflow history in the same way as other payloads, so cart contents, session tokens or personal data sent with a signal can be readable by anyone with history access. Temporal supports payload encryption through custom codecs and a codec server. Decide which fields must be encrypted, test that the Web UI and CLI show decrypted values only to authorized users, and document the key ownership.

Keep services off the public internet

The Temporal deployment docs say Temporal services should run on hosts not reachable from the public internet, with network access restricted to trusted internal networks. For Signal-With-Start, this means the endpoint that accepts signals is reachable only from your application tier. Verify the network policy from outside your environment and record the result, because a public signal endpoint combined with an open Authorizer gives an attacker both start and write access.

Monitor duplicate and unexpected starts

Operationally, decide which callers may send signals to which workflow IDs, and write that rule down as part of the workflow ID design. Then monitor for workflows started by an unexpected caller, for workflow IDs that do not match the expected pattern, and for a rise in signals arriving for workflows that did not exist before. Ask your team to confirm which alerts exist, who receives them, and how a suspicious start is investigated, since these alerts are rarely built in by default.

How DeployOpen scopes and delivers Temporal create-or-update flows

DeployOpen plans, implements, hardens, documents and supports self-hosted open-source platforms inside your own infrastructure. For Signal-With-Start flows, we start from the entities and message types your teams need, then build and test the start-or-signal logic in Temporal inside your cloud accounts, data centers or air-gapped networks.

How we scope

  • Map which entities need a workflow per ID, and which messages must reach them before or after start
  • Record the Workflow ID scheme, reuse policy and expected signal volume for each workflow type
  • Agree deployment target, namespace layout and whether Temporal runs self-hosted or on Temporal Cloud
  • Confirm the written scope, deliverables and timeline before any build work starts

How we build

  • Implement Signal-With-Start calls in the client services that send messages to per-entity workflows
  • Write workflow code with signal handlers, idle exit paths and versioned changes for later updates
  • Test start-without-signal, signal-to-running and duplicate-message cases with the Temporal test framework
  • Configure mTLS, API authorization and network restrictions for the Temporal Service in your environment

How we hand over

  • Deliver workflow design notes covering IDs, signal names, payload shapes and retention behavior
  • Provide runbooks for stuck workflows, signal failures and worker scaling, written for your operators
  • Document the test results and the configuration evidence your security and compliance teams will ask for
  • Train your engineers on how the code changes safely, using the handover material and a walkthrough

How we support

  • Offer ongoing support, upgrades and continuous testing for Temporal services as a retainer
  • Plan Temporal Server upgrades one minor version at a time, with schema upgrades run first when release notes require them
  • Review new workflow types and signal changes before they reach production
  • Retest after changes to signal handling, authorization or the underlying persistence layer

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.