Common Use Cases

This document provides end-to-end examples of common business scenarios resolved using the Workflow Orchestration engine.

Scenario: Scheduled Report Emailing

Requirement: On the 1st day of every month, generate an Excel report of all overdue invoices and send it as a secure download link to the Financial Controller.

Step 1: Create the Report Definition

First, a user (or administrator) creates a Report in the UI named "Overdue_Invoices_Report". It filters Invoice where Status == "Overdue" and configures the relevant columns and sums.

Step 2: Configure the Workflow Trigger

Create a new Workflow targeting the Invoice entity. Set the Trigger type to Schedule using standard Cron syntax for the 1st of the month: 0 0 1 * *.

(Note: Because the Report Definition already contains the filter Status == "Overdue", you do not need to populate the AudienceFilter in the trigger. We only need the workflow to fire once, so the Audience is irrelevant. We just target a dummy entity).

Step 3: Define Context Variables

We need variables to hold the state as the workflow executes.

Step 4: The Execution Graph

Node 1: Generate the Report Use the GenerateReport node.

Node 2: Create Secure Link (C# Script) Because emails are plain text, sending a physical attachment is often less secure than sending an ephemeral, authenticated link. We use a RunCustomAction node targeting a script named "Invoice_Action_CreateLink".

Script Code:

// Read the FileId generated by the previous node
int fileId = (int)WorkflowContext.Variables["FileId"];

// Generate a link valid for 1 use, expiring in 48 hours
string url = await SecureDownloads.CreateLinkAsync(fileId, 1, DateTime.UtcNow.AddHours(48));

// Save it back to workflow memory
WorkflowContext.Variables["DownloadLink"] = url;

Node 3: Send Email Use the SendEmail node.

Node 4: Exit Use the Exit node to terminate the flow cleanly.