Workflows execution
Creating a Workflow
Before initiating an workflow, we need to establish a definition file. Let’s begin by creating a simple one with the provided YAML
Let’s save this file as my-workflow.yaml
. We can now create the workflow using the following command:
Executing the above command will save this workflow, and return an ID that can be used to execute it as a workflow instance. The output of the above command should look like this:
For the sake of learning the available commands, let’s verify that the workflow was successfully saved by listing all our created workflows:
Executing a Workflow
Alright; we have now created our first workflow, but nothing has happened yet within the ledger flows-demo-001
that we used in the workflow definition. Let’s jump straight to the fun part and execute our workflow as a workflow instance. We can do so using the following command:
Checking a Workflow instance status
Workflow instances are living entities. Their current state of execution and termination can be checked using the following command:
Debugging a Workflow instance
If you’re having trouble understanding what a workflow instance is currently doing, you can use the following command to get a detailed view of its current internal state:
Terminating a Workflow instance
There are cases where you might want to terminate a workflow instance, e.g. when you want to recreate it after making changes to definition or restart it after a failure with different variables.
If you want to do so, you can simply use the following command: