Call patterns from patterns
Compose patterns into reusable building blocks using On Pattern Call, Call Pattern, and Respond With.
As your automations grow, you will find logic that repeats across multiple patterns — sending a notification, validating input, or formatting a report. Instead of duplicating this logic, you can extract it into a standalone pattern and call it from other patterns like a function. DRAGOPS supports this through three nodes: On Pattern Call, Call Pattern, and Respond With.
How pattern composition works
Pattern composition follows a caller/callee model:
- The callee pattern uses an On Pattern Call trigger to define its inputs. It performs its work and uses a Respond With node to return results.
- The caller pattern uses a Call Pattern node to invoke the callee, pass data in, and receive the response.
Both patterns must be deployed for calling to work. When the caller reaches a Call Pattern node, the execution engine starts the callee pattern, waits for it to complete, and returns the result to the caller.
What you will build
Two patterns:
- Send Notification — a reusable pattern that accepts a
channelandmessage, sends a formatted message to a logging endpoint, and returns a success status. - Order Processor — a webhook-triggered pattern that receives an order, calls Send Notification to confirm it, and logs the result.
Part 1: Build the callee pattern
Step 1: Create the pattern
- Open the DRAGOPS dashboard.
- Select New Pattern.
- Enter the name "Send Notification" and select Create.
Step 2: Add the On Pattern Call trigger
- Remove the default On Start node.
- Right-click on the canvas to open the node search menu.
- Search for "On Pattern Call" and add it to the canvas.
The On Pattern Call node defines the interface for this pattern. Other patterns send data through this trigger when they call it.
Step 3: Define the input parameters
Select the On Pattern Call node to open the Inspector Panel on the left side. Add two input parameters:
- channel (String) — the destination for the notification
- message (String) — the notification text
These parameters appear as output data pins on the On Pattern Call node, making the values available to downstream nodes.
Step 4: Build the notification logic
- Add a Format node. Set the template to
[{0}] {1}. - Wire On Pattern Call's channel output pin to Format's first input.
- Wire On Pattern Call's message output pin to Format's second input.
- Add a Log node and wire Format's Result output pin to Log's Message input pin.
- Wire the execution flow: On Pattern Call to Log.
Step 5: Return a result with Respond With
- Right-click on the canvas and search for "Respond With".
- Add the Respond With node to the canvas, after the Log node.
- Wire Log's execution output pin to Respond With's execution input pin.
The Respond With node sends data back to the caller. Add the output fields you want to return:
- Select the Respond With node to open the Inspector Panel.
- Add an output parameter: status (String).
- Add a String literal node, set its value to
sent, and wire it to Respond With's status input pin.
Step 6: Deploy the callee
Select Deploy in the toolbar. The Send Notification pattern is now live and ready to receive calls from other patterns.
Part 2: Build the caller pattern
Step 1: Create the pattern
- Return to the dashboard and select New Pattern.
- Enter the name "Order Processor" and select Create.
Step 2: Add a webhook trigger
- Remove the default On Start node.
- Right-click on the canvas, search for "On Webhook", and add it to the canvas.
Step 3: Extract order data
- Add a Get Property node. Set the Key to
item. - Wire On Webhook's Body output pin to Get Property's Object input pin.
- Wire the execution flow from On Webhook to Get Property.
Step 4: Call the Send Notification pattern
- Right-click on the canvas and search for "Call Pattern".
- Add the Call Pattern node to the canvas.
- Select the Call Pattern node to open the Inspector Panel.
- In the Pattern dropdown, select "Send Notification".
After selecting the pattern, the Call Pattern node displays input pins matching the callee's On Pattern Call parameters. Wire the inputs:
- Add a String literal node with the value
ordersand wire it to Call Pattern's channel input pin. - Add a Format node with the template
New order received: {0}. Wire Get Property's Value output pin to Format's first input. Wire Format's Result to Call Pattern's message input pin. - Wire the execution flow from Get Property to Call Pattern.
Step 5: Use the response
Call Pattern also has output pins matching the callee's Respond With parameters. In this case, it has a status output pin.
- Add a Log node. Set up a Format node with the template
Notification status: {0}. - Wire Call Pattern's status output pin to Format's first input.
- Wire Format's Result to Log's Message input pin.
- Wire the execution flow from Call Pattern to Log.
Step 6: Deploy and test
- Select Deploy in the toolbar.
- Copy the webhook URL from the Triggers panel.
- Send a test request:
curl -X POST https://your-webhook-url \
-H "Content-Type: application/json" \
-d '{"item": "Widget Pro"}'The execution log for Order Processor shows:
Notification status: sentThe execution log for Send Notification shows a separate execution triggered by the Call Pattern node:
[orders] New order received: Widget ProWhen to use composition
Pattern composition is most valuable when:
- Shared logic — Multiple patterns need the same functionality (notifications, validation, formatting). Extract it once and call it everywhere.
- Separation of concerns — Keep patterns focused on a single responsibility. A webhook handler should not contain notification delivery logic.
- Independent deployment — Update the callee without modifying every caller. As long as the interface (inputs and outputs) stays the same, callers continue to work.
Avoid composition when the logic is simple and used in only one place. The overhead of a separate pattern is not worth it for a few nodes used once.