Examples
Complete Fork + Join configurations for notification aggregation, API merging, and parallel validation.
Example 1: Order Notification — Aggregate Channel Results
Simultaneously send email, SMS, and Slack notifications. After the Join, check how many channels succeeded and route accordingly.
// Parallel Fork
{
"node_type": "ParallelFork",
"node_id": "NotifyChannels",
"config": { "fail_fast": false },
"connections": {
"success": ["SendEmail", "SendSms", "PostSlack"]
}
}
// Parallel Join (no config needed)
{
"node_type": "ParallelJoin",
"node_id": "WaitForNotifications"
}
// After Join success port fires:
// $var.lane_success_count → 3 (if all succeeded)
// $var.lane_0_emailSent → true
// $var.lane_1_smsSent → true
// $var.lane_2_slackPosted → true
// Downstream IfCondition:
// "$var.lane_success_count >= 1" → at least one channel worked → proceed
// "$var.lane_success_count === 0" → all channels failed → escalate
Expected outcome: Even if one channel fails, the workflow proceeds if at least one notification was delivered. All channel statuses are available for the audit log.
Example 2: Customer Enrichment — Merge All API Results
Call three enrichment APIs concurrently, then merge their results into a unified customer risk profile. All three are required, so fail_fast is enabled.
// Parallel Fork
{
"node_type": "ParallelFork",
"node_id": "EnrichCustomer",
"config": { "fail_fast": true },
"connections": {
"success": [
"CallCreditAPI", // lane 0: sets creditScore
"CallFraudAPI", // lane 1: sets riskLevel
"CallLoyaltyAPI" // lane 2: sets loyaltyTier
]
}
}
// After Parallel Join fires success:
// $var.lane_0_creditScore → 742
// $var.lane_1_riskLevel → "low"
// $var.lane_2_loyaltyTier → "gold"
// Downstream SetVariable node creates:
// customerProfile = {
// creditScore: $var.lane_0_creditScore,
// riskLevel: $var.lane_1_riskLevel,
// loyaltyTier: $var.lane_2_loyaltyTier
// }
Expected outcome: All three API results are merged into a single customerProfile object. If any API fails, the workflow routes to an error handler immediately (fail_fast), preventing a partial profile from being used.
Example 3: Parallel Validation — Loan Application Checks
Run four validation checks in parallel for a loan application. After the Join, confirm all four passed before approving.
// Parallel Fork
{
"node_type": "ParallelFork",
"node_id": "RunValidations",
"config": { "fail_fast": false },
"connections": {
"success": [
"CheckCreditHistory", // lane 0: sets creditPassed
"VerifyIdentity", // lane 1: sets identityPassed
"VerifyIncome", // lane 2: sets incomePassed
"VerifyAddress" // lane 3: sets addressPassed
]
}
}
// After Parallel Join fires:
// lane_success_count = 4 (if all pass)
// $var.lane_0_creditPassed → true
// $var.lane_1_identityPassed → true
// $var.lane_2_incomePassed → true
// $var.lane_3_addressPassed → false ← address check failed
// Downstream IfCondition:
// "$var.lane_0_creditPassed && $var.lane_1_identityPassed &&
// $var.lane_2_incomePassed && $var.lane_3_addressPassed"
// true: → ApproveLoanApplication
// false: → RouteToHumanReview (with specific failed checks identified)
Expected outcome: All four checks run concurrently. The Join provides individual pass/fail for each check. The downstream node identifies exactly which checks failed (address in this case) and routes the application to human review with the failure details populated.
Example 4: Document Generation — Collect All Document URLs
Generate four documents in parallel and collect all their storage URLs into a single array after the Join. The array is used to attach all documents to the outbound email.
// Parallel Fork
{
"node_type": "ParallelFork",
"node_id": "GenerateDocuments",
"config": { "fail_fast": false },
"connections": {
"success": [
"GenerateInvoice", // lane 0: sets documentUrl
"GenerateShippingLabel", // lane 1: sets documentUrl
"GeneratePickList", // lane 2: sets documentUrl
"GenerateRemittance" // lane 3: sets documentUrl
]
}
}
// After Parallel Join fires:
// lane_outputs[0].documentUrl → "https://storage.../invoice-001.pdf"
// lane_outputs[1].documentUrl → "https://storage.../label-001.pdf"
// lane_outputs[2].documentUrl → "https://storage.../picklist-001.pdf"
// lane_outputs[3].documentUrl → "https://storage.../remittance-001.pdf"
// SetVariable:
// allDocumentUrls = lane_outputs.map(l => l.documentUrl)
// → ["https://.../invoice-001.pdf", "https://.../label-001.pdf", ...]
// SendDispatchEmail uses: $var.allDocumentUrls as attachment list
Expected outcome: All four documents are generated concurrently. The Join provides the lane_outputs array, from which all document URLs are extracted into a flat array. The dispatch email is sent with all four documents attached in a single operation.