Skip to main content

Flow Engine (Beta)

The Flow Engine Component allows you to use the Automate feature and control the agent with custom workflows.

Note

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:

NameDescriptionDefault
enabledWhether to enable the Flow Engine plugin or not.true
logLevelThe 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.

NameDescription
getDefinitionsGet the list of all flows loaded on the robot.
getManifestGet the manifest of a given loaded flow.
loadDefinitionsSend all necessary data that defines a flow to a robot.
removeDefinitionRemove loaded definition of a given flow (along with related resources and topics).
startFlowStart 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.
startFlowAndWaitStart 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.
stopFlowStop a flow instance that you do not want running any more.
waitFlowReadyWait until flow definitions are available on the robot.
Note

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.

NameDescriptionDefault
logLevelWhich level of logs should be published from the flow system. From 0 (extremely quiet) to 6 (very talkative).0
tracingWhether to enable tracing capabilities.false
argumentsArgument's values to be passed to flow. Arguments' names and types have to be previously declared in manifest.
restartEnable restart policy if not set to "no"."no"
Note

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 :

  1. Agent level : flows
  2. Flow level : flows/<flowId>
  3. Instance level : flows/<flowId>/<instanceId>
Info

Topics under flows/<flowId>/* are only available once the related flow has started.

NameDescription
globalsList of global values.
logsAgent's log messages.
stateFlow'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.

NameDescription
historyExposes the complete call information of the entire flow.
snapshotExposes call information for the entry points that are still running. Any entry points that have completed will not show up in the snapshot.
returnThe 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.
registryThe symbol registry contained with the flow system.
Warning

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.