When a running Temporal workflow needs outside input, which message type to use
A Temporal Workflow Execution often keeps running for hours or days, and something outside it eventually needs to act on it: an API that shows a customer where an order stands, an operator who wants to cancel a step, or a payment service that must know a workflow accepted its change before it replies. Temporal provides three message types for this, and choosing the wrong one is the most common design mistake in this area. A Query is a non-blocking read. It returns the workflow's current state without changing history. A Signal is an asynchronous write with no response: the sender delivers a message and moves on. An Update is a synchronous tracked write, so the sender can wait for the workflow to validate the request and return a result. Temporal's workflow message passing documentation defines these three types and the guarantees each one gives.
Use a Query when the caller needs to see state and nothing else, such as a status page or a dashboard polling a workflow. Use a Signal when the caller can accept that the workflow will process the message later and will never confirm it, such as a notification that a document was uploaded. Use an Update when the caller must know the change was accepted, for example to approve a refund amount, change a deadline, or reject a request that breaks a business rule. The Update path lets the workflow validate input and return an error to the caller, which a Signal cannot do. Teams should map each external call in their design to one of these three answers before writing any handler code.
Before committing to a design, confirm two things in your own environment. First, check that each workflow's handlers can tolerate the message order and retries your clients will produce, since a Signal sent during a retry window can arrive more than once in practice. Second, confirm the pending message limits on your Temporal version. Open source Temporal caps each Workflow Execution at 2,000 pending Activities, Child Workflows, Signals or cancellation requests by default, documented in the self-hosted defaults and limits reference. A caller that pushes Signals faster than the workflow drains them will hit that cap, so high-volume producers need batching, backpressure or an Update that waits for acknowledgment.
Signal, Query or Update: which fits each message
This table compares Temporal Signals, Queries and Updates on whether they read or write workflow state, whether the sender gets a response, and whether the sender can wait for a result. Read each row against the message you need to send to a running Workflow, then check the row for the option that matches your required answer.
| Message type | Read or write | Response to sender | Typical use |
|---|---|---|---|
| Query | Read | Yes, returns the workflow's current state | Dashboards or status checks that show progress without changing the Workflow |
| Query, non-blocking requirement | Read | Yes, non-blocking read | Operators or services that need a snapshot while the Workflow keeps running |
| Signal | Write | No response returned to the sender | Fire-and-forget notifications, such as a customer cancelling an order or an external event arriving |
| Signal, sender does not wait | Write | No, asynchronous with no response | High-volume inputs where the sender does not need confirmation the Workflow acted |
| Update | Write | Yes, synchronous tracked write that can return a result | Requests that change Workflow state and need the caller to receive an outcome |
| Update, sender waits for result | Write | Yes, sender can wait for the result | Approvals or changes where the caller must know the outcome before continuing |
| Choosing between Signal and Update | Both write | Signal returns nothing, Update can | Pick Update when the sender needs an answer, Signal when it does not |
How to decide between Signals, Queries and Updates
Each Temporal message type answers a different question about a running Workflow. The four decisions below, taken in order, point you to a Query, a Signal or an Update before you write any handler code.
Does the call change workflow state?
A Query only reads state and must not change it. Use a Query when a dashboard, API or operator needs the current status of a Workflow Execution. A Signal or an Update is needed when the message must alter what the Workflow does next. Queries are non-blocking reads, so any code path that mutates state inside a Query handler is a design error. Confirm in your SDK how read-only handlers are enforced and tested.
Message passing docsDoes the caller need a result?
A Signal is asynchronous and returns no response, so the sender cannot learn what the Workflow did with it. An Update is synchronous and tracked, so the sender can wait and receive a result or an error. If a caller must act on the outcome, such as confirming an approval was recorded, choose an Update. Signals suit fire-and-forget notifications, such as a customer uploading a document that the Workflow will process later.
Must the caller know the write was accepted?
Signals give the sender no confirmation of delivery to the Workflow Execution beyond the send itself. Updates are tracked, so the caller gets a handle it can poll or wait on. Where a silent drop would cause a financial, compliance or customer-facing error, prefer an Update. Test the failure path in your environment, including what the calling service does when the Workflow has already completed.
Must the message be validated first?
An Update can run a validator before the Workflow records it, so invalid input is rejected without entering history. Signals have no equivalent gate, so the Workflow must check and handle bad input itself after it has been recorded. Keep validators free of side effects and confirm in your SDK that validation runs before the write is accepted and how rejections surface to the caller.
Can pending messages build up?
Open source Temporal limits each Workflow Execution to 2,000 pending Activities, Child Workflows, Signals or cancellation requests by default. A high-volume Signal source can reach that limit, so batch or throttle senders, or move bulk input into Activities. Check the defaults for your self-hosted version and confirm how your SDK reports a rejected send.
Self-hosted defaultsHow a client message reaches a running workflow
A client sends one of three message types to the Temporal Frontend, which routes it to the Workflow Execution that owns the message. A Query is a non-blocking read that returns state without changing it. A Signal is an asynchronous write that returns no response. An Update is a tracked write whose sender can wait for a result. In every path, the handler code runs inside the workflow, so check that handlers are defined there and that the sender uses the right message type for its needs.
Query, Signal and Update paths from a client to the workflow handlers.
How validation and pending message limits work in practice
Input validation belongs at the boundary where a message enters the Workflow Execution, before any state is changed. Signals cannot return an error to the sender, so a Signal handler that receives a bad value has no direct way to tell the caller. The safer pattern is to keep Signal handlers thin, record the message, and let the Workflow logic decide what to do with it, while checking that the data is well formed before it reaches anything that writes to an external system.
- Check shape before acting: confirm required fields, enum values and identifiers in the handler, then branch on the result.
- Keep handlers free of side effects: do not call Activities or external services from inside a handler; hand the validated value to the main Workflow code.
- Record rejected input: store a rejected Signal in Workflow state or a log so operators can see what arrived and why it was ignored.
- Define an input contract per message name: document the expected payload and version it when the Signal shape changes.
- Test with malformed payloads: add tests that send unexpected values and confirm the Workflow still reaches a defined state.
Before release, list every Signal your Workflow accepts and confirm for each one what happens to invalid input, who sees the outcome, and where that outcome is recorded.
Updates are the message type that can be validated before they are accepted. The Update validator runs before the Update is written to history, so an invalid request can be refused and the caller receives an error. This makes Updates the right choice when a caller needs to know that a change was rejected, and when the rejection must happen before any state changes.
- Validate in the validator function: reject bad arguments there, and keep the handler body for the state change itself.
- Keep validators pure: a validator should read state and arguments only, without side effects or waits.
- Return a clear error to the caller: make the message specific enough that an API client can act on it.
- Handle the rejection path in clients: a caller that sends an Update must treat a rejected Update as a normal outcome, not a crash.
- Plan for concurrent changes: check that the state a validator reads is still valid when the handler runs, since other messages may have changed it in between.
For each Update, confirm which conditions reject it, what the caller receives in each case, and whether the same request can be sent again safely after a rejection.
Open source Temporal limits each Workflow Execution to 2,000 pending Activities, Child Workflows, Signals or cancellation requests by default. A Workflow that keeps accepting Signals faster than it processes them can reach this limit, and the platform then stops accepting further pending messages for that execution. The limit counts work that is queued but not yet handled, so a Workflow that drains its inbox steadily stays well below it.
- Know the default and where it is set: the 2,000 figure is the open source default, so confirm your deployment's configured value.
- Identify high-volume senders: find the producers that can send bursts, such as batch jobs or retry loops.
- Drain Signals in the main loop: process queued messages in batches so the pending count falls between bursts.
- Use Continue-As-New for long-lived inboxes: start a fresh execution with carried state when history and queues grow large.
- Throttle at the sender: add rate limits or batching in the calling service so bursts do not reach the Workflow at once.
Ask the platform team to confirm the configured limit for each namespace and to test what the sending client sees when the limit is reached.
Callers retry after timeouts and network errors, so a handler must give the same result when it receives the same request twice. For Signals, that means adding a request identifier to the payload and recording processed identifiers in Workflow state. For Updates, the Update ID gives the caller a way to check whether a request is already running. Designing for repeats is what keeps retries from double-applying a state change.
- Use idempotency keys: include a unique ID in each Signal payload and skip IDs that were already processed.
- Use stable Update IDs: generate the ID once on the client and reuse it on retry.
- Make handlers set-based: write state so that applying a change twice produces the same state.
- Watch backlog signals: track pending message counts, Workflow task latency and the age of the oldest unprocessed message, and alert before the limit is reached.
- Expire deduplication records: decide how long processed IDs are kept, based on the longest retry window your callers use.
Before go-live, run a test that replays duplicate messages and a burst near the limit, and confirm that the metrics and alerts fire as expected.
Setting up signal, query and update handlers on a self-hosted service
This sequence takes a team from agreeing the message contract to a verified handler set running against a test namespace on a self-hosted Temporal Service, with the pending and latency checks that show the handlers behave under load.
Define the handler contract with the SDK
The workflow owner and the teams that send messages agree on each Signal, Query and Update: its name, its input and output types, whether the sender waits for a result, and which caller may send it. Engineers then declare these handlers using the method names for their chosen SDK, which you should confirm in that SDK's documentation before writing code. The step is done when every message has a written contract, a named owner and a matching type definition shared by the workflow and client code.
Implement Query handlers as read-only
Engineers write Query handlers that only read workflow state and return it, without starting activities, changing variables that drive workflow logic or waiting on other work. Queries are non-blocking reads, so a handler that writes state or waits can produce inconsistent answers and will not behave as the caller expects. The step is done when each Query handler passes a review that confirms it has no side effects and returns a value derived only from workflow state.
Implement Signal and Update handlers with validation
Engineers implement Signal handlers, which record asynchronous writes and return no response, and Update handlers, which accept a synchronous tracked write and can return a result to the sender. Update handlers should include a validator that rejects invalid input before the update is recorded in history, so bad requests fail fast for the caller. Teams should also confirm how their SDK handles pending Signals that arrive while a handler is still running. The step is done when each handler has a unit test for accepted input, rejected input and the expected return value.
Test replay and determinism
Engineers replay recorded workflow histories against the new handler code to confirm that adding or changing handlers does not break determinism for executions already running. Handler changes that alter the order of commands or branch on new conditions require a versioning decision before deployment. The step is done when replay tests pass on representative histories from the test namespace and the team has recorded which handler changes need a versioning path.
Run a client against a test namespace
Engineers deploy the workflow and worker code to a test namespace on the self-hosted Temporal Service, then run a client that sends each Signal, Query and Update to a live workflow. The test should cover the success path, a rejected Update and a Query issued while the workflow is waiting. The step is done when each message type returns the expected result in the test namespace and the client logs show the Update outcomes the contract defined.
Check pending counts and handler latency
Operators check the number of pending Signals and other pending operations per Workflow Execution, which Temporal limits to 2,000 by default on open source. They also review the latency of Update and Query handling through the metrics their monitoring stack collects, and confirm the exact metric names with the Temporal documentation for their server version. The step is done when test runs show pending counts well below the limit, latency is recorded for each message type, and the team has agreed an alert for a rising pending count.
Security and operational considerations for message handlers
Signals, Queries and Updates are reachable through the same frontend API as every other Temporal call, so the controls that protect a self-hosted cluster also protect its running workflows. The cards below cover who can call the API, how callers are identified, how message data is protected and where the services sit on the network.
Configure an Authorizer
If no Authorizer is configured, self-hosted Temporal uses the default noopAuthorizer, which allows every API request with no authentication or access control. That means any network client that reaches the frontend can send a Signal that changes a running workflow or an Update that alters its state. Before any message handler is exposed, confirm that a custom Authorizer is in place and that it decides per namespace which callers may signal, query or update.
Security docsMap caller identity with ClaimMapper
The ClaimMapper turns JWT or certificate claims into namespace roles, and the Authorizer uses those roles to decide each request. Map each service account or application to the narrowest role it needs, so a read-only dashboard can run Queries but cannot send Updates. Test the mapping with a caller from each role, because a mapping mistake can grant write access that looks correct in configuration review.
Enforce mTLS on frontend traffic
Self-hosted Temporal supports mTLS with separate settings for internode and frontend traffic, so the client-facing listener can require client certificates while internal service traffic is protected on its own terms. Frontend mTLS gives the ClaimMapper a verified certificate identity to work with. Check that SDK clients are configured with their certificates and that certificate rotation is part of the operations runbook.
Encrypt message payloads with codecs
Signal, Query and Update arguments and results are stored and displayed as payloads, so a customer identifier or approval decision in a message is visible in history and the Web UI unless it is protected. Custom codecs encrypt payloads in the SDK before they leave the client, and a codec server lets authorized users decode them in the UI. Decide which fields are sensitive, confirm that every sending and receiving SDK uses the same codec, and plan key storage before go-live.
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. A reachable frontend with a permissive Authorizer lets anyone with network access send messages to any workflow they can guess the ID of. Restrict ingress to the frontend and to approved client networks, and verify the restriction from outside the trusted network as part of acceptance testing.
Deployment docsBound pending messages per workflow
Open source Temporal limits each Workflow Execution to 2,000 pending Activities, Child Workflows, Signals or cancellation requests by default. A sender that floods one workflow with Signals can exhaust that budget and block other work on it, so rate limits at the calling service matter as much as access control. Confirm the default with your server version, decide which callers may send bursts, and alert when a workflow's pending count climbs.
Defaults and limitsQuestions teams ask before choosing message types
Should I use a Signal or an Update for a write to a running workflow?
Use an Update when the caller needs a result or needs to know the change was accepted, and use a Signal when the sender only needs to deliver an instruction and does not wait. A Signal is an asynchronous write with no response, so the sender cannot tell whether the workflow rejected or handled it. An Update is a synchronous tracked write, so the sender can wait for a result and the workflow can validate the input before it changes state. Start from the caller's need: if a user interface, API client or operator must see the outcome, choose an Update. The Temporal message passing documentation describes the three types side by side.
Do Queries change a workflow's history?
No. A Query is a non-blocking read request, so it lets callers inspect a running workflow's state without sending it a command. Because it only reads, it is the right choice for dashboards, status pages and support tooling that need current values. Queries should not change state or trigger activities, so keep their handlers small and side-effect free. Confirm the exact behavior for your SDK version and language before you rely on it, because handler semantics differ between SDKs.
How much effort do handler design and tests take?
Effort depends on how many message types the workflow exposes and how much logic each handler carries. Each Signal, Query and Update needs a handler, input and output types, and an agreed contract with the callers that use it. Updates add validation logic, which must run deterministically and must be tested for both accepted and rejected inputs. Tests should cover ordering with other signals, replay of histories that contain messages, and behavior when the workflow is already completing. Ask any partner to show the test plan and the list of message types before agreeing on a price, since that list shapes most of the work.
What must our team provide before the work starts?
Your team needs to provide the workflows that will receive messages, the callers that will send them (user interfaces, services, operator tools), and the expected behavior for each message. You should also provide the SDK and language in use, the Temporal deployment model, and the rules for who may send which messages. Engineers who own the workflow code must be available to review handler design, because message handlers change workflow behavior and must stay compatible with replay. Agree these inputs in a written scope before work starts.
Can our own engineers build this without outside help?
Yes, many teams do this in-house, especially when the team already runs Temporal workflows in production and knows the SDK well. The main risks are handler determinism, ordering of messages against workflow code changes, and testing replay across versions. If the team has not built workflows with message handlers before, a review of the design and the tests by someone with that experience can reduce rework. Decide based on your team's current Temporal skills and the number of message types you need, and document the choice.
What makes the effort go up or down?
The number of message types, the complexity of validation, and the number of external callers drive effort up. Updates that call activities or depend on external state take more design and test work than simple Signals that only record a value. Effort goes down when message contracts are settled early, when handlers stay small, and when the team reuses an established pattern across workflows. Also plan for the open source default limit of 2,000 pending Activities, Child Workflows, Signals or cancellation requests per Workflow Execution, since a design that sends very large volumes of Signals needs throttling or batching. The self-hosted defaults page lists this limit.
What should we confirm about pending signal limits?
Confirm the limit that applies to your deployment and whether your team has changed it. The open source default is 2,000 pending Activities, Child Workflows, Signals or cancellation requests per Workflow Execution. If a sender can exceed that number, for example during a burst of events, the workflow needs a design that batches messages or waits for progress before sending more. Test that behavior under load, and confirm with your platform team how the limit is configured in your environment before you go live.
How DeployOpen works on this
DeployOpen scopes the choice between Temporal Signals, Queries and Updates before any code is written, then builds and hands over the message handlers, validation and operating notes your team needs. The work runs inside infrastructure you control, under a written scope that sets out what is built, tested and documented.
How we scope
- Inventory each workflow that receives outside input and classify every interaction as a read, a fire-and-forget write or an awaited write.
- Agree in writing which workflows get Signals, Queries or Updates, and which callers must wait for a result.
- Set the limits for each workflow, including the default cap of 2,000 pending Signals and other pending operations on open source Temporal.
How we build
- Implement Query handlers as read-only code that inspects workflow state without changing it or blocking the workflow.
- Build Update handlers with validators that reject bad input before the workflow records the Update in history.
- Test each handler with the Temporal SDK test tooling and replay checks so message changes do not break running workflows.
How we hand over
- Deliver the handler catalog, caller guidance and example client code for each message type, with the reasons behind each choice.
- Document the pending-message limits, retry behavior and what callers should do when a message is rejected or times out.
- Walk your engineers through the test suite and runbook so they can add or change handlers after the engagement ends.
How we support
- Review message traffic and pending-message counts with your team after go-live to catch workflows approaching their limits.
- Update handlers and tests when workflow code changes, following the versioning plan agreed during the build.
- Offer ongoing support, upgrades and continuous testing as a retainer if your team wants a partner for the long term.

