Signal System

Overview

Master Compozy's event-driven communication system for building reactive, scalable workflows with signal-based coordination patterns

Overview

Signals are lightweight messages that enable workflows to communicate asynchronously. Unlike direct task dependencies, signals provide a decoupled coordination mechanism where publishers and subscribers operate independently.

Event-Driven Architecture

Build reactive systems that respond to business events as they occur

Loose Coupling

Workflows coordinate without direct dependencies or knowledge of each other

Asynchronous Communication

Non-blocking message passing enables parallel workflow execution

Data Propagation

Share structured payloads between workflows with type safety

Signal Components

How Signals Work

Loading diagram...

Signal Flow Architecture

1

Signal Publication

Signals are published via signal tasks, Event API, or external systems with structured payloads

2

Temporal Routing

Temporal signal dispatcher routes signals through a dedicated Dispatcher Workflow that manages signal distribution to matching wait tasks and signal triggers based on signal IDs

3

Signal Processing

Processors transform and validate signal data using agents or tools

4

Workflow Orchestration

Target workflows continue execution or start automatically with signal data accessible via template variables

5

Response & Cascading

Processing results can trigger additional signals, creating sophisticated event chains and coordination patterns

Basic Usage

# Send a signal when task completes
- id: notify-completion
  type: signal
  signal:
    id: "order-processed"
    payload:
      order_id: "{{ .workflow.input.order_id }}"
      status: "{{ .task.output.status }}"
      total: "{{ .task.output.total }}"

Learn more in Signal Tasks.

Signal Architecture Patterns

Core Usage Scenarios

Human-in-the-Loop

Approval workflows with escalation and timeout handling

Service Orchestration

Coordinate microservices and distributed systems

Event-Driven Pipelines

Reactive data processing and ETL workflows

External Integrations

Webhook handling and API response coordination
Request approval
- id: request-approval
  type: signal
  signal:
    id: "approval-request"
    payload:
      request_id: "{{ .workflow.id }}"
      type: "budget-increase"
      amount: "{{ .workflow.input.amount }}"
      requestor: "{{ .workflow.input.user }}"
Wait for manager approval
- id: await-approval
  type: wait
  wait_for: "manager-approval"
  on_timeout: escalate-request

Advanced Features

Signal Processing

Wait tasks can process signals using optional processors:

- id: priority-handler
  type: wait
  wait_for: "task-update"
  processor:
    type: basic
    tool:
      id: task-processor
    with:
      task_data: "{{ .signal.payload }}"

Signal Timeouts

Handle scenarios where signals might not arrive:

- id: wait-with-fallback
  type: wait
  wait_for: "external-webhook"
  on_timeout: use-default-values

Multi-Signal Coordination

Use composite tasks to coordinate multiple signals:

- id: wait-all-approvals
  type: composite
  mode: parallel
  wait_all: true
  tasks:
    - type: wait
      wait_for: "manager-approval"
      on_timeout: handle-manager-timeout
    - type: wait
      wait_for: "compliance-approval"
      on_timeout: handle-compliance-timeout
    - type: wait
      wait_for: "finance-approval"
      on_timeout: handle-finance-timeout

Best Practices & Guidelines

Semantic Naming

Use clear, hierarchical names: domain-entity-action pattern

Timeout Strategy

Always implement timeouts with meaningful fallback actions

Payload Optimization

Balance completeness with performance - include essential context

Next Steps