Syntax
Steps and Actions
Steps and actions are the building blocks of workflows in Keep Workflow Engine. While they share a similar structure and syntax, the difference between steps and actions is mostly semantic:
- Steps: Focused on querying data or triggering fetch-like operations from providers (e.g., querying databases, fetching logs, or retrieving information).
- Actions: Geared toward notifying or triggering outcomes, such as sending notifications, updating tickets, or invoking external services.
Together, steps and actions allow workflows to both gather the necessary data and act upon it.
General Structure
Both steps and actions are defined using a similar schema:
Steps
Used for querying or fetching data.
Step uses the _query
method of each provider.
Actions
Used for notifications or triggering effects.
Action uses the _notify
method of each provider.
Examples
Fetch data from a MySQL database
Retrieve logs from Datadog
Query Kubernetes for running pods
Send an email
Send a Slack Message
Create a ticket in ServiceNow
Combining Steps and Actions
A workflow typically combines steps (for querying data) with actions (for notifications or outcomes).
Here’s few examples:
Query and Notify
Alert and Incident Management
Error Handling and Retries
Both steps and actions support error handling to ensure workflows can recover from failures.