Job context
When a job is launched, Data Factory attaches a context object to the job execution input. It describes who launched the job, from where, when, and on which items. Use it to build jobs that adapt their behavior to the way they were launched.
The context is available in any task through the ${workflow.input.context} expression.
json
{
"name": "json-transform-jq",
"taskReferenceName": "read_context",
"type": "SUB_WORKFLOW",
"inputParameters": {
"data": {
"origin": "${workflow.input.context.jobActionOrigin}",
"triggerAt": "${workflow.input.context.triggerAt}"
},
"queryExpression": ".data"
}
}1
2
3
4
5
6
7
8
9
10
11
12
2
3
4
5
6
7
8
9
10
11
12
Structure
json
{
"context": {
"jobAccountId": "4203",
"jobId": "6a8867e0b09beb1cbe7a091f",
"jobInstanceId": "6a886e4a9195b3835af2a5c3",
"jobActionOrigin": "APP",
"triggerAt": "2026-08-21T15:27:06.940Z",
"userAccountId": "4203",
"userShardId": "4203",
"userId": "8",
"view": {
"context": { "id": "4203", "key": "debb2d4f-626f-4b77-92fe-dec3152c4274" },
"table": { "id": "1470", "key": "PRODUCTS" },
"partition": { "id": "2386", "key": "ACTIVES" },
"screen": { "id": "3962", "key": "ALL_COLUMNS" }
},
"queryMode": "API_V1",
"query": {
"type": "in",
"caseSensitive": true,
"field": "id",
"value": ["6590553"]
},
"selection": { "...": "legacy, see below" }
}
}1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
json
{
"context": {
"jobAccountId": "4203",
"jobId": "6a8867e0b09beb1cbe7a091f",
"jobInstanceId": "6a886f4d9195b3835af2a5c6",
"jobActionOrigin": "PERIODIC",
"triggerAt": "2026-08-21T09:00:00.000Z",
"userAccountId": "4203",
"userShardId": "4203",
"userId": "8"
}
}1
2
3
4
5
6
7
8
9
10
11
12
2
3
4
5
6
7
8
9
10
11
12
| Property | Type | Description |
|---|---|---|
| ID of the account that owns the job. | ||
| ID of the launched job. | ||
| ID of the current job execution. | ||
| How the job was launched. See Origin. | ||
| Date and time the job was launched (ISO 8601, UTC). | ||
| ID of the account of the user who launched the job. | ||
| ID of the user who launched the job. | ||
| State of the screen when the job was launched. Only present when the job is launched from an interface. See View. | ||
| : | Format of the item selection. Absent when no item is selected and no filter is applied. See Query. | |
Selected or filtered items, in the Find request format. Only present when queryMode = API_V1. | ||
| Legacy selection format. See Legacy properties. |
Origin
The jobActionOrigin property tells you how the job was launched.
| Value | Description |
|---|---|
APP | Launched by a user from app.product-live.com. |
SETTINGS | Launched by a user from settings.product-live.com. |
API | Launched through the Data Factory API. |
PERIODIC | Launched automatically by a periodicity rule. |
TIP
Combine jobActionOrigin with a SWITCH task to run different branches, for example to export only the selected items when the job is launched from the app, and the whole catalog when it runs periodically.
View
The view object describes the screen the user was working on when they launched the job. It is only present when jobActionOrigin is APP or SETTINGS. It is absent for API and PERIODIC launches.
| Property | Type | Description |
|---|---|---|
id and key of the account context in which the screen is displayed. | ||
id and key of the active table. | ||
id and key of the active partition. | ||
id and key of the active screen. |
Query
The query property describes the items targeted by the user, in the same format as the find endpoints of the Product-Live API. You can pass it as is to a find task or endpoint to retrieve the same items. Refer to the Find request documentation for the full syntax.
| User action in the grid | queryMode | query |
|---|---|---|
| No item selected, no filter | absent | absent |
| Some items selected | API_V1 | { "type": "in", "field": "id", "value": ["id1", "id2"] } |
| All filtered items exported, no filter applied | API_V1 | { "type": "true" } |
| All filtered items exported, with filters | API_V1 | One query per filter, combined with { "type": "and", "queries": [...] } |
| A filter that cannot be expressed in the Find format (for example, items with new suggestions) | LEGACY | absent |
WARNING
When queryMode = LEGACY, query is not provided. Rely on the legacy selection property, or let the tasks that support the USER_SELECTION mode (for example table-export-items) handle the selection for you.
Filter conversion
Grid filters are converted as follows:
| Grid filter | query |
|---|---|
Contains v | { "type": "search", "value": "%v%" } |
Equals v | { "type": "in", "value": ["v"] } |
Starts with v | { "type": "search", "value": "v%" } |
Ends with v | { "type": "search", "value": "%v" } |
| Option is one of | { "type": "in", "value": [...] } |
| Option is not one of | { "type": "or", "queries": [{ "type": "isNull" }, { "type": "notIn", "value": [...] }] } |
| Number minimum | { "type": "greaterOrEqual", ... } |
| Number maximum | { "type": "lowerOrEqual", ... } |
| Range (number or date) | { "type": "and", "queries": [greaterOrEqual, lowerOrEqual] } |
| Is empty | { "type": "isNull", ... } |
Fields are referenced with { "key": "<FIELD_KEY>", "target": "item.fields" }.
INFO
"Option is not one of" also returns items without a value, as the grid does.
Use cases
Record the launch date in a table
Use triggerAt to store the date of the run on the processed items, for example in an XSLT transformation:
json
{
"name": "file-transformation-xslt",
"taskReferenceName": "add_trigger_date",
"type": "SUB_WORKFLOW",
"inputParameters": {
"mode": "FILE",
"file": "${table_export_items.output.file}",
"params": [
{
"name": "triggerAt",
"select": "${workflow.input.context.triggerAt}"
}
],
"xslt": "file://assets/transform.xslt"
}
}1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
Adapt the job to its origin
json
{
"name": "switch_task",
"taskReferenceName": "by_origin",
"type": "SWITCH",
"inputParameters": {
"case_value_param": "${workflow.input.context.jobActionOrigin}"
},
"evaluatorType": "value-param",
"expression": "case_value_param",
"decisionCases": {
"APP": [],
"PERIODIC": []
}
}1
2
3
4
5
6
7
8
9
10
11
12
13
14
2
3
4
5
6
7
8
9
10
11
12
13
14