ScriptableFlowRunnerResult - Scoped
-
- UpdatedJan 30, 2025
- 5 minutes to read
- Yokohama
- API reference
Captures the result of using ScriptableFlowRunner to execute a flow, subflow, or action. Includes data such as the context ID, domain, and any outputs from the flow execution.
Use these methods in your server-side scripts with the sn_fd
namespace
identifier.
API call Order
Build and execute flows, subflows, and actions using these APIs in the following order:
- 1. FlowAPI: Creates a builder object
- Use getRunner() to instantiate the ScriptableFlowRunner builder object.
- 2. ScriptableFlowRunner: Specify Workflow Studio content to run
- Use these methods in the following order to create the builder pattern:
- Use one of the methods action(), datastream(), flow(), or subflow() to specify what type of Workflow Studio object to build.
- Use one or more methods such as addInput(), inDomain(), or quick() to specify execution parameters.
- Use the run() method to run the action, flow, or subflow with the provided parameters and return a ScriptableFlowRunnerResult object.
- 3. ScriptableFlowRunnerResult: Retrieve Workflow Studio execution details
- Use one or more methods such as getContextId(), getOutputs(), and getDomainId() to view execution details.
Example
This example shows how to create a ScriptableFlowRunner builder object and uses it to execute an approval action on a specific record. A ScriptableFlowRunnerResult object captures the execution arguments and action outputs.
ScriptableFlowRunnerResult - debug()
Returns information about the executed flow, subflow, or action, including the context ID, domain ID, and execution outputs.
Name | Type | Description |
---|---|---|
None |
Type | Description |
---|---|
String | Execution details about the Workflow Studio action, flow, or
subflow run.
|
Example
This example shows how to retrieve information about the executed flow, subflow, or action from the ScriptableFlowRunnerResult object.
ScriptableFlowRunnerResult - getContextId()
Returns the context ID of the flow, subflow, or action.
Name | Type | Description |
---|---|---|
None |
Type | Description |
---|---|
String | The sys_id of the Workflow Studio execution details record for the action, flow, or subflow. |
Example
This example shows how to retrieve a context ID from a ScriptableFlowRunnerResult object.
ScriptableFlowRunnerResult - getDate()
Returns the date and time when a Workflow Studio action, flow, or subflow ran as a GlideDateTime object.
Name | Type | Description |
---|---|---|
None |
Type | Description |
---|---|
GlideDateTime | The execution date and time for the flow, subflow, or action. |
Example
This example shows how to retrieve the date and time of a flow execution from a ScriptableFlowRunnerResult object.
ScriptableFlowRunnerResult - getDataStream()
Returns the stream of data from a data stream action.
If the datastream() method was used in the ScriptableFlowRunner builder class, this returns the stream of data as a ScriptableDataStream object. Use the ScriptableDataStream class to iterate over items in the stream. See ScriptableDataStream.
For more information about data stream actions, see Data Stream actions and pagination.
Name | Type | Description |
---|---|---|
None |
Type | Description |
---|---|
ScriptableDataStream | A ScriptableDataStream object you can use to iterate through items in a data stream. Use the methods in the ScriptableDataStream class to interact with this object. See ScriptableDataStream. |
Example
This example shows how to retrieve a data stream from a ScriptableFlowRunnerResult object.
ScriptableFlowRunnerResult - getDomainId()
Returns the sys_id of the domain that the Workflow Studio action, flow, or subflow ran in.
Name | Type | Description |
---|---|---|
None |
Type | Description |
---|---|
String | The sys_id of the domain that the Workflow Studio action, flow, or subflow ran in. |
Example
This example shows how to retrieve a domain ID from a ScriptableFlowRunnerResult object.
ScriptableFlowRunnerResult - getFlowObjectType()
Returns the type of Workflow Studio object run.
Name | Type | Description |
---|---|---|
None |
Type | Description |
---|---|
FlowObjectType | The type of Workflow Studio object run, which is either action, flow, or subflow. |
Example
This example shows how to retrieve the flow object type from the ScriptableFlowRunnerResult API.
ScriptableFlowRunnerResult - getFlowObjectName()
Returns the scope and internal name of the Workflow Studio action, flow, or subflow run.
Name | Type | Description |
---|---|---|
None |
Type | Description |
---|---|
String | The scope and internal name of the Workflow Studio action, flow,
or subflow run. For example, global.emailflow . |
Example
This example shows how to retrieve the name of the flow, subflow, or action name from a ScriptableFlowRunnerResult object.
ScriptableFlowRunnerResult - getOutputs()
Returns the outputs of a completed Workflow Studio action, flow, or subflow.
Name | Type | Description |
---|---|---|
None |
Type | Description |
---|---|
Object | Object containing the output of a completed Workflow Studio action, flow, or subflow. |
Example
This example shows how to retrieve the outputs from a Workflow Studio action, flow, or subflow run with the ScriptableFlowRunner API.
On this page
- API call Order
- Example
- ScriptableFlowRunnerResult - debug()
- ScriptableFlowRunnerResult - getContextId()
- ScriptableFlowRunnerResult - getDate()
- ScriptableFlowRunnerResult - getDataStream()
- ScriptableFlowRunnerResult - getDomainId()
- ScriptableFlowRunnerResult - getFlowObjectType()
- ScriptableFlowRunnerResult - getFlowObjectName()
- ScriptableFlowRunnerResult - getOutputs()