Signal Tasks
Understanding signal tasks for inter-workflow communication and event-driven coordination in Compozy workflows
Overview
Signal tasks are the event broadcasters of Compozy's event-driven architecture. They enable workflows to send structured messages that coordinate between processes, trigger asynchronous actions, and implement sophisticated publish-subscribe patterns. When combined with wait tasks, signal tasks create powerful synchronization mechanisms that form the backbone of Compozy's event-driven signal system.
Core Capabilities
Signal tasks provide essential event-driven coordination features:
Event Broadcasting
Inter-Workflow Communication
Template-Driven Payloads
Immediate Execution
Task Structure
Signal tasks use a simple yet powerful configuration structure built on Compozy's task configuration system. Every signal task contains two essential components: the signal identification and payload data.
id: signal-task-name
type: signal
signal:
id: "signal-identifier"
payload:
data: "{{ .workflow.input.value }}"
timestamp: "{{ now }}"
outputs:
signal_dispatched: "{{ .task.outputs.signal_dispatched }}"
signal_id: "{{ .task.outputs.signal_id }}"
Task Type
Signal Block
Template Support
Outputs
Integration with Wait Tasks
Signal tasks enable robust, event-driven communication between independent workflows. One workflow can notify or trigger actions in another, allowing for decoupled orchestration and real-time coordination across complex business processes. This mechanism is essential for building scalable systems where workflows need to interact, synchronize, or respond to events generated elsewhere in the platform.
id: complete-order-processing
type: signal
signal:
id: "order-ready-for-fulfillment"
payload:
order_id: "{{ .workflow.input.order_id }}"
customer_id: "{{ .workflow.input.customer_id }}"
items: "{{ .task.output.processed_items }}"
# Fulfillment instructions
fulfillment_instructions:
shipping_method: "{{ .workflow.input.shipping_method }}"
priority: "{{ .workflow.input.priority }}"
special_instructions: "{{ .workflow.input.special_instructions }}"
# Order metadata
order_metadata:
total_amount: "{{ .task.output.total_amount }}"
payment_confirmed: "{{ .task.output.payment_confirmed }}"
processed_at: "{{ now }}"
id: wait-for-order
type: wait
wait_for: "order-ready-for-fulfillment"
condition: 'signal.payload.order_metadata.payment_confirmed == true'
timeout: 3600s # 1 hour
processor:
type: basic
agent:
id: fulfillment-processor
instructions: "Process order for fulfillment"
with:
order_data: "{{ .signal.payload }}"
fulfillment_center: "{{ .workflow.input.fulfillment_center }}"
outputs:
fulfillment_initiated: "{{ .processor.output.initiated }}"
estimated_shipping: "{{ .processor.output.estimated_shipping }}"
Best Practices
Follow these established patterns to build reliable and maintainable signal-driven workflows. These practices ensure signal tasks integrate effectively with the broader event-driven architecture and support debugging, monitoring, and system reliability.
Descriptive Signal IDs
Consistent Payload Structure
Essential Context Only
Reference Large Data
Version Compatibility
Debugging Metadata
Summary
Signal tasks form the foundation of event-driven workflows in Compozy, enabling loose coupling, scalable coordination, and sophisticated inter-workflow communication patterns. Their immediate execution and flexible payload system make them ideal for creating responsive, event-driven applications.