Workflow functions

The following sections contain ArcGIS Arcade expressions that allow you to access the history of work performed on a job. This includes obtaining results from specific steps, webhooks, and the last person assigned to a step. These expressions don't attach files or logs to a job, but they can be used to guide the workflow, assign steps to specific users or groups, and access specific types of output values.

LastRunner

The LastRunner expression returns the username of the last person who ran the specified step.

Parameters

LastRunner(job_id, step_id)

NameExplanationData type

job_id

The ID of the job.

String

step_id

The ID of the step in the workflow diagram.

String

Output

Returns a string value of the username of the last person who ran the specified step.

Expression sample

The following expression returns the username of the last person who ran the current job's specified step:

LastRunner($Job, 'f50d740d-cc04-9296-4ce3-181e82604465')
Example output
jdoe

JobReturnValue

The JobReturnValue expression returns a completed step's return value. This expression is typically used to confirm whether a step failed or was successful, and it is commonly used when investigating steps that have failed to run properly.

Parameters

JobReturnValue(job_id, step_id)

NameExplanationData type

job_id

The ID of the job.

String

step_id

The ID of the step in the workflow diagram.

String

Output

Returns a string value of the specified step's return value for the specified job.

Expression sample

The following expression returns the return value of the specified step for the current job:

JobReturnValue($Job, 'f50d740d-cc04-9296-4ce3-181e82604465')
Example output
S000001

JobOutputValue

The JobOutputValue expression returns the output value for a completed step.

Parameters for step output values

JobOutputValue (job_id, step_id, {value_name})

NameExplanationData type

job_id

The ID of the job.

String

step_id

The ID of the step in the workflow diagram.

String

value_name

(Optional)

The specific output value key for steps with multiple output values. The first value is returned by default.

String

Expression samples

The following expression returns the Status step output value for a Send Web Request step:

JobOutputValue($Job, 'e31395eb-dafc-2a11-777c-6da02c86e122', 'Status')
Example output
200

JobOutputArray

The JobOutputArray expression returns a completed step's output value as an Arcade array type. This expression can only be used with the Send Web Request step.

Parameters for step output values

JobOutputArray(job_id, step_id, {value_name})

NameExplanationData type

job_id

The ID of the job.

String

step_id

The ID of the step in the workflow diagram.

String

value_name

(Optional)

The specific output value key for steps with multiple output values. The first value is returned by default.

String

Output

Returns the JSON string array of a completed step's output value as an Arcade array type.

Expression example

The following expression returns the dates output value for the current job's specified step:

JobOutputArray($Job, 'd27395ec-ddfe-2b11-777a-6df02e86d835', 'dates')
Example output
['2022-01-20', '2022-02-21']

Related topics