+ {lines.map((line, i) => {
+ const lineNum = i + 1;
+ const isActive = activeLines.has(lineNum);
+ return (
+
+ {line || ' '}
+
+ );
+ })}
+
+ + Code examples for all five SDKs. Select a message type and language, then click an + annotation to highlight the relevant lines. +
+ + {/* Message type tabs */} ++ {data.description} +
+ + {/* Two-column code view */} ++ {ann.description} +
+ )} ++ Watch how each message type travels between your client code and a running Workflow. +
+ + {/* Type tabs */} ++ Each type handles a different situation. Pick based on whether you need a response, + whether you need to change state, and whether the caller can wait. +
+ +{content.description}
+| + {p.label} + | ++ {p.value} + | +
| Situation | +Use | +Why | +
|---|---|---|
| Push a notification, no response needed | +Signal | +Async, durable delivery, no waiting | +
| Read current state without touching it | +Query | +Synchronous read, no history entry written | +
| Change state and confirm it worked | +Update | +Validates input, returns a result, durable | +
| One Workflow triggers work in another | +Signal | +Standard pattern for Workflow-to-Workflow communication | +
+ You've started a long-running Workflow. It's running. Now what? How do you check on + its progress? How do you tell it something changed? How do you get a value out of it? +
+ ++ You define named handlers on your Workflow for three types of messages:{' '} + Signals (push a notification in),{' '} + Queries (read state out), and{' '} + Updates (change state and get a result back). + Your client calls them by name on a Workflow handle, and the running Workflow reacts. +
++ Say you have a chef cooking a multi-course meal. The meal is in progress + and the chef keeps working, but the rest of the restaurant still needs to reach them: +
++ A waiter tells the chef "Table six would like more bread." The chef notes it and keeps cooking. + No reply needed. The waiter moves on. +
++ A manager asks "How many courses have gone out?" The chef checks the board + and answers without stopping work. +
++ A customer asks "Can you add a dessert?" The chef checks if there's still time. + If yes: "Added." If no: "The order is already closed." The customer waits for that answer + before leaving the table. +
+| Type | +Like saying... | +Gets a response? | +Can change state? | +
|---|---|---|---|
| Signal | +"Hey, FYI" | +No | +Yes | +
| Query | +"What's the current status?" | +Yes (read-only) | +No | +
| Update | +"Please change X and confirm it" | +Yes (result or rejection) | +Yes | +
handle.signal(approve)
+ handle.query(get_status)
+ handle.execute_update(set_priority, 3)
+ @workflow.signal approve()
+ @workflow.query get_status()
+ @workflow.update set_priority()
+ + Full reference for Signals, Queries, and Updates: delivery guarantees, edge cases, and how each type is recorded in event history. +
+ + Read the docs + ++ SDK-specific guidance for Go, TypeScript, Python, Java, and .NET. +
+ ++ One atomic operation: starts a Workflow if it does not exist, then sends a signal to it. Useful when you are not sure if the Workflow is already running. +
+ + Learn more + ++ You can send an Update and poll for the result later without blocking your client. Useful when the Update handler takes a while to complete. +
+ + Explore + +