Your First Workflow
Learn how to define and run workflows in Inferable
Workflows are defined and triggered as code. This guide will walk you through creating your first workflow.
Defining a Workflow
A workflow must have a name and an input schema with a executionId
field.
The executionId
is used to track the execution of the workflow. It is a
unique identifier for the execution of the workflow. You can trigger a
workflow many times, but as long as the executionId
is the same, you will
get the same result.
Example: Risk Analysis Workflow
Let’s build a workflow that analyzes the risk of a loan. It must:
- Get the loan records for the customer
- Analyze the risk of each loan record
- If the risk for any one loan record is too high, notify the customer of the rejection
- If the risk is not too high, analyze the risk profile to get the aggregate risk, and notify the customer
Triggering Workflows
To make your workflow discoverable by the control plane, you need to register it by calling workflow.listen()
.
Once registered, the workflow can be called from any machine with access to your Inferable cluster:
Was this page helpful?