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. This expression is typically used in workflows that include a quality assurance or quality control review in which work may need to be redirected back to the person who originally performed edits to resolve issues that were identified during the review process.

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 was successful or failed and it is commonly used when investigating steps that have failed to run properly, such as a geoprocessing or create version step.

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 or the output value for a completed webhook action.

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

Parameters for webhook action output values

JobOutputValue (job_id, action_type, {value_name})

NameExplanationData type

job_id

The ID of the job.

String

action_type

The name of the webhook action that created the output value. Currently, CreateJob is the only supported action type.

String

value_name

(Optional)

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

String

Output

Returns a string value of the output value for a completed step or the output value for a completed webhook action.

Expression samples

The following expression returns the num_acres step output value for a Run GP Service step:

JobOutputValue($Job, 'd27395ec-ddfe-2b11-777a-6df02e86d835', 'num_acres')
Example output
123

The following expression returns the errorsIdentified step output value for an Evaluate Data Quality step:

JobOutputValue($Job, '0105f656-1cd0-4424-af9b-f75ede7fdcf0', 'errorsIdentified')
Example output
2

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

The following expression returns the Request Number output value for the CreateJob webhook action:

JobOutputValue($Job, 'CreateJob', 'Request Number')
Example output
123456

JobOutputArray

The JobOutputArray expression returns a completed step's output value or a completed webhook action's output value as an Arcade array type. This expression can only be used with the Create Version step, the Send Web Request step, and webhook output values.

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

Parameters for webhook action output values

JobOutputArray(job_id, action_type, {value_name})

NameExplanationData type

job_id

The ID of the job.

String

action_type

The name of the webhook action that created the output value. Currently, CreateJob is the only supported action type.

String

value_name

(Optional)

The specific output value key for webhook actions 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 or a completed webhook action'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']

The following expression returns the dates output value for the CreateJob webhook action:

JobOutputArray($Job, 'CreateJob', 'dates')
Example output
['2022-01-20', '2022-02-21']

Related topics