Skip to main content

Leverage workflow helper objects to retrieve related data

Zuora

Leverage workflow helper objects to retrieve related data

Describes the available workflow helper objects.

Workflow provides the following helper objects for you to query the related data within a workflow:

  • WorkflowInstance: Data of the current workflow run
  • WorkflowSetup: Setup data of the workflow version
  • TaskInstance: Data of the workflow task instance
  • Credentials.zuora: Information about the user who issued the workflow run

You can use Liquid to query against the above objects.

For example, the following query can be used in a Logic: Data Query task to retrieve the result of the current workflow run:

Select * from workflow_task where workflowid = {{ WorkflowInstance.id }}

This query leverages {{ WorkflowInstance.id }} to retrieve the current Workflow run ID.

Refer to the following data tables when using the workflow helper objects.

WorkflowInstance

The WorkflowInstance object contains the following fields:

Field Name

Description

Example

id

ID of the workflow run

{{ WorkflowInstance.id }}

name

Name of the workflow run

status

Status of the workflow run

run_time

Total run time of the workflow run

started_at

The starting time of the workflow run

finished_at

The finish time of the workflow run

created_at

The creation time of the workflow run

updated_at

The last updated time of the workflow run

TotalTaskCount

The total task count of the workflow run

{{ WorkflowInstance.TotalTasksCount }}

QueuedTaskCount

The queued task count of the workflow run

ProcessingTaskCount

The processing task count of the workflow run

PendingTaskCount

The pending task count of the workflow run

StoppedTaskCount

The stopped task count of the workflow run

SuccessTaskCount

The successful task count of the workflow run

ErrorTaskCount

The errored task count of the workflow run

LastExecution

The last execution workflow run object

{{ WorkflowInstance.LastExecution.PendingTaskCount }}

{{ WorkflowInstance.LastExecution.started_at }}

PendingTasks

The pending tasks (limit 15)

{{ WorkflowInstance.PendingTasks.size }}

 

{{ WorkflowInstance.PendingTasks | map: "error"  }}

 

{% for task in WorkflowInstance.PendingTasks %}{{ task.status }}{% endfor %}

ErrorTasks

The errored tasks (limit 15)

SuccessTasks

The successful tasks (limit 15)

ErrorMessages

Messages for errored tasks in array (limit 15)

 

{% for message in WorkflowInstance.PendingMessages %}{{ message }}{% endfor %}

PendingMessages

Messages for pending tasks in array(limit 15)

WorkflowSetup

The WorkflowSetup object contains the following fields:

Field Name

Description

Example

id

The ID of the workflow version

{{ WorkflowSetup.id }}

name

The name of the workflow definition


TaskInstance

The TaskInstance object contains the following fields:

Field Name

Description

Example

id

Task ID

{{ TaskInstance.id }}

iterate_row_reference

The unique row number that occurred from iterate sequence

name

Tasks name

created_at

The time when the task is created

updated_at

The last updated time of the task

start_time

The time the task is started

original_task_id

The original ID of the task from workflow setup configuration

status

The status of the task

error

The error message of the task

data

The data passed into this task

error_details

The log of the error

error_class

The error class

Credentials.zuora

The Credentials.zuora object contains the following fields:

Field Name

Description

Example

entity_id

The entity ID of the user

{{ Credentials.zuora.entity_id }}

rest_endpoint

The REST API endpoint of the workflow run 

username

The username of the user

password

The password of the user

client_id

The client_id of the user

client_secret

The client_secret of the user

url

The public zuora  login url

session

The zuora session

bearer_token

The bearer_token of the user