Get Started with Workflow Automation¶
Plan your automation carefully to ensure a successful implementation. Define clear objectives and specific requirements before building. By identifying business challenges and their root causes upfront, you can determine the most effective workflow design for your process needs.
Plan Your Automation¶
Identify the Business Challenge¶
Begin by determining the specific problem your automation will address. Consider the following questions to assess where workflow automation can deliver the greatest impact.
- Do employees spend excessive time on repetitive data entry instead of higher-value activities?
- Are critical tasks frequently delayed, overlooked, or completed inconsistently?
- Is inaccurate or outdated data causing downstream issues across your organization?
- Have you lost visibility into the current status of customer engagements or internal processes?
- Are employees manually transferring information between systems or applications?
- Do stakeholders lack timely notifications when key business events occur?
If one or more of these challenges applies to your organization, workflow automation can help standardize operations, reduce manual effort, and improve data accuracy.
Define Clear Objectives¶
Before configuring a workflow, establish goals that are specific, measurable, and aligned with business outcomes.
- Specific: Define precise objectives. For example, "automatically create a follow-up task when a new lead is added" rather than "improve lead management."
- Measurable: Identify quantitative indicators of success such as reduction in manual steps, processing time, or error rates.
- Achievable: Set targets informed by your workflow complexity and data volume.
- Relevant: Ensure objectives align with the business purpose of the automation — a reorder workflow may prioritize accuracy, while a notification workflow may prioritize speed.
Outline the Workflow Steps¶
Map out your process by answering three questions:
- What starts the workflow? Determine the trigger event. A manual trigger allows users to initiate the workflow on demand when they need to execute a defined process.
- What does the workflow do? Identify the actions the workflow must perform — such as evaluating data, creating records, or generating notifications.
- What data does each step need? Consider what information flows between steps. Each action can access outputs from previous steps through the workflow context.
Design Your Workflow¶
A workflow consists of three components that define its structure and behavior:
Nodes¶
Each node represents an individual step. There are two categories:
- Triggers define how the workflow starts. A manual trigger, for example, enables users to initiate execution on demand, recording the trigger timestamp and relevant metadata.
- Actions perform the work within the workflow. Code actions execute Python logic with access to the workflow context, previous node outputs, and a curated set of built-in functions.
Edges¶
Edges connect nodes and define the execution sequence. The Workflow Engine resolves the dependency graph using topological sorting, ensuring each step executes only after its prerequisites are complete.
Metadata¶
Descriptive information about the workflow, including its name and identifier, supports organization and discoverability.
Configure and Test¶
Define the Workflow in Settings¶
Workflows are defined as structured configurations within your application settings. Each workflow specifies its nodes, edges, and metadata:
'WORKFLOWS': {
'lead_follow_up': {
'meta': {'name': 'Lead Follow-Up Task Creation'},
'nodes': {
'trigger_start': {
'name': 'Initiate Process',
'type': 'grit.core.workflows.triggers.manual',
'type_version': 1
},
'create_task': {
'name': 'Create Follow-Up Task',
'type': 'grit.core.workflows.actions.code',
'type_version': 1,
'py_code': (
'lead_name = wf.get("lead_name")\n'
'node.set("task", f"Follow up with {lead_name} within 48 hours")\n'
'node.set("priority", "high")'
)
}
},
'edges': {
'edge_1': {
'source_node_id': 'trigger_start',
'target_node_id': 'create_task'
}
}
}
}
Execute via API¶
Trigger workflow execution programmatically through the dedicated API endpoints:
POST /api/workflows/<workflow_id>/run— Execute a workflowGET /api/workflows— List all available workflowsGET /api/workflows/<workflow_id>— Retrieve workflow configuration details
Validate Before Deployment¶
Test workflows with representative data and varied scenarios before deploying to production. Verify that:
- Each node executes in the expected order.
- Context data passes correctly between steps.
- Error conditions are handled appropriately.
- Execution results match your defined success criteria.
Workflow Examples¶
Example: Lead Follow-Up Task Creation¶
Challenge: Sales representatives inconsistently follow up with new leads, resulting in missed opportunities and delayed outreach.
Solution: Automate the creation of follow-up tasks whenever the lead qualification process is initiated.
- Trigger: A manual trigger initiates the follow-up workflow.
- Action: A code action evaluates lead information, assigns a priority level based on predefined criteria, and creates a follow-up task with a specified deadline.
Example: Inventory Reorder Alerts¶
Challenge: Warehouse teams manually monitor stock levels across product lines, leading to delayed reorder requests and occasional stockouts.
Solution: Automate inventory threshold monitoring and reorder notification generation.
- Trigger: A manual trigger initiates the stock review process.
- Action 1: A code action queries current inventory levels and compares them against configured minimum thresholds.
- Action 2: A subsequent code action generates reorder notifications and creates purchase order records for items that fall below the required level.
Example: Membership Expiration Notifications¶
Challenge: Customer membership renewals are tracked manually, resulting in missed renewal windows and lost recurring revenue.
Solution: Automate the identification of expiring memberships and notify customers before their renewal deadline.
- Trigger: A manual trigger initiates the membership review cycle.
- Action 1: A code action scans membership records and identifies accounts approaching their expiration date within a configured timeframe.
- Action 2: A subsequent action generates renewal reminder notifications for each identified account and updates the membership status to pending renewal.