Portal Community

Example 1 — Early Exit on Cancellation Condition

A subscription renewal workflow first checks whether the customer has already cancelled their account. If the account is already inactive, there is nothing to renew — terminate immediately with a cancelled status.

// Switch node checks var.accountStatus === 'inactive'
// If true, routes to this Stop Workflow node:
{
  "node_type": "StopWorkflow",
  "name": "AccountAlreadyInactive",
  "config": {
    "status": "cancelled",
    "message_expression": "{@ 'Account ' + var.accountId + ' is already inactive. No renewal action taken.' }"
  }
}
Outcome: Execution record shows status cancelled with a clear message. The monitoring dashboard does not alert on this as an error. The account team can filter for these in reporting to understand churn timing.

Example 2 — Terminate After Maximum Retries

A retry loop attempts to call a payment API up to 3 times. After the third failure, a Loop Break node exits the loop and the workflow terminates with failed status, logging the last error.

{
  "node_type": "StopWorkflow",
  "name": "PaymentAPIMaxRetriesExceeded",
  "config": {
    "status": "failed",
    "message_expression": "{@ 'Payment API call failed after ' + var.retryCount + ' attempts. Order ' + var.orderId + ' could not be processed. Last error: ' + var.lastApiError }"
  }
}
Outcome: The monitoring dashboard's failure alert fires. The message includes the order ID and exact error, allowing the support team to investigate the specific transaction without digging through logs.

Example 3 — Stop on Data Validation Failure

A contact import workflow validates each record before processing. If a required field is missing or malformed, stop the workflow immediately rather than processing invalid data into the CRM.

{
  "node_type": "StopWorkflow",
  "name": "ContactValidationFailed",
  "config": {
    "status": "failed",
    "message_expression": "{@ 'Validation failed for contact record. Field: ' + var.failedField + '. Value received: \"' + var.failedValue + '\". Expected: ' + var.expectedFormat }"
  }
}
Outcome: The import batch is halted at the first invalid record. The message tells the data team exactly which field and value caused the rejection, enabling them to fix the source data and re-trigger the import.

Example 4 — Explicit Success Completion with Summary

An invoice generation workflow ends with a rich success message that summarises what was accomplished. This message appears in the execution history and can be surfaced in dashboards.

{
  "node_type": "StopWorkflow",
  "name": "InvoiceGenerationComplete",
  "config": {
    "status": "success",
    "message_expression": "{@ 'Invoice ' + var.invoiceNumber + ' (total: $' + var.invoiceTotal + ') generated and emailed to ' + var.customerEmail + ' at ' + var.completedAt + '.' }"
  }
}
Outcome: The execution history entry reads: "Invoice INV-2026-0042 (total: $486.00) generated and emailed to jane.doe@company.com at 2026-05-23T10:34:00Z." Finance and ops teams can audit this without needing to inspect raw logs.

Example 5 — Business Rule Short-Circuit

A duplicate detection check at the start of an order processing workflow identifies that this order was already processed (idempotency check). Stop immediately to avoid double-processing.

// IfCondition: var.isDuplicateOrder === true → routes here
{
  "node_type": "StopWorkflow",
  "name": "DuplicateOrderDetected",
  "config": {
    "status": "cancelled",
    "message_expression": "{@ 'Duplicate order detected. Order ' + var.orderId + ' was already processed on ' + var.originalProcessedAt + ' (execution ID: ' + var.originalExecutionId + '). No further action taken.' }"
  }
}
Outcome: Status is cancelled (not failed) because this is an expected, handled condition. The message provides a full audit trail pointing to the original execution. Monitoring does not alert, and the order is not double-charged or double-shipped.