Flow Engine (Beta)
The Flow Engine Component allows you to use the Automate feature and control the agent with custom workflows.
Agent version 1.6 or higher is required for Rocos Automate.
Configuration
To use the Flow Engine, your agent will need a section in its agent-settings.json
file which enables the flow-engine
component, as shown below. For more information on how to configure the agent plugins, see Agent Configuration.
...
"components": [
...
{
"enabled": true,
"id": "flow-engine",
"settings": {
"logLevel": 4
}
},
...
]
The Flow Engine plugin understands the following configuration parameters:
Name | Description | Default |
---|---|---|
enabled | Whether to enable the Flow Engine plugin or not. | true |
logLevel | The logging verbosity: from 1 (very quiet) to 6 (very talkative). | 4 |
Services
The flow-engine exposes various services that provide all access necessary to control flows directly.
Name | Description |
---|---|
getDefinitions | Get the list of all flows loaded on the robot. |
getManifest | Get the manifest of a given loaded flow. |
loadDefinitions | Send all necessary data that defines a flow to a robot. |
removeDefinition | Remove loaded definition of a given flow (along with related resources and topics). |
startFlow | Start a flow with a specified flow ID. This will return immediately without waiting for the flow to complete. Optionally, the instance ID can also be specified. If left empty, the instance ID is generated by the flow engine. |
startFlowAndWait | Start a flow with a specified flow ID. This will only return once the flow has completed. Optionally, the instance ID can also be specified. If left empty, the instance ID is generated by the flow engine. |
stopFlow | Stop a flow instance that you do not want running any more. |
waitFlowReady | Wait until flow definitions are available on the robot. |
getManifest
is only available for version 1.6.14 or higher.
removeDefinition
is only available for version 1.6.16 or higher.
All flows defined in the system have an ID. This flow ID is what is displayed on the Automate page. It is unique to a particular flow, but does not uniquely identify a specific instance of a flow. This is where a second identifier called the instance ID comes in. If not specified by the user when starting the flow, the instance ID is automatically generated by the flow engine and will be globally unique across all flows.
When using the startFlow and startFlowAndWait service calls, you can pass extra settings.
Name | Description | Default |
---|---|---|
logLevel | Which level of logs should be published from the flow system. From 0 (extremely quiet) to 6 (very talkative). | 0 |
tracing | Whether to enable tracing capabilities. | false |
arguments | Argument's values to be passed to flow. Arguments' names and types have to be previously declared in manifest. | |
restart | Enable restart policy if not set to "no". | "no" |
Agent version 1.6.14 or higher is required for passing arguments to flows.
Telemetry
The flow-engine exposes various telemetry topics to monitor flows at runtime.
Telemetry topics are nested in three hierarchical levels :
- Agent level :
flows
- Flow level :
flows/<flowId>
- Instance level :
flows/<flowId>/<instanceId>
Topics under flows/<flowId>/*
are only available once the related flow has started.
Name | Description |
---|---|
globals | List of global values. |
logs | Agent's log messages. |
state | Flow's state (e.g. starting, completed). |
<flowId> | Loading status of flow's file on agent. |
When tracing is enabled for a flow, this causes extra topics to be published.
Name | Description |
---|---|
history | Exposes the complete call information of the entire flow. |
snapshot | Exposes call information for the entry points that are still running. Any entry points that have completed will not show up in the snapshot. |
return | The return values from a flow. This can be useful to work out why a flow is failing as the return data will contain the error. |
registry | The symbol registry contained with the flow system. |
Be careful with the history topic for long-running flows, as the data can grow without bound. This should only be used while testing a flow.