Skip to main content
<Signal> is the ergonomic form of <WaitForEvent> when the signal name should match the node id and the payload should be typed by a Zod schema.

Import

import { Signal } from "smithers-orchestrator";

Props

PropTypeDefaultDescription
idstring(required)Signal name and node id.
schemaz.ZodObject(required)Typed payload schema and output target.
correlationIdstringundefinedCorrelation key for matching a specific signal instance.
timeoutMsnumberundefinedMax wait time in ms.
onTimeout"fail" | "skip" | "continue""fail"Timeout behavior.
asyncbooleanfalseWhen true, unrelated downstream flow can continue while the signal is still pending. Explicit dependencies still wait for the payload.
skipIfbooleanfalseSkip this node entirely.
dependsOnstring[]undefinedTask IDs that must complete first.
needsRecord<string, string>undefinedNamed deps. Keys become context keys, values are task IDs.
labelstringsignal:<id>Display label override.
metaRecord<string, unknown>undefinedExtra metadata.
children(data) => ReactNodeundefinedOptional typed render callback that mounts only after the signal payload exists.

Example

import { Signal, Task, Workflow, createSmithers } from "smithers-orchestrator";
import { z } from "zod";

const { smithers, outputs } = createSmithers({
  feedback: z.object({
    rating: z.number(),
    comment: z.string(),
  }),
  summary: z.object({
    upper: z.string(),
  }),
});

export default smithers(() => (
  <Workflow name="signal-demo">
    <Signal id="user-feedback" schema={outputs.feedback} async>
      {(feedback) => (
        <Task id="summarize" output={outputs.summary}>
          {{ upper: feedback.comment.toUpperCase() }}
        </Task>
      )}
    </Signal>
  </Workflow>
));

Behavior

  • <Signal> renders a <WaitForEvent> internally with event={id} and output={schema}.
  • Without children, it behaves like a plain typed wait.
  • With children, the callback runs only after the payload has been received and validated.
  • Async signal waits contribute to smithers_external_wait_async_pending{kind="event"} while unresolved.