Jobs
Requirement
- You have done the Create my first job tutorial
- You have installed the VS code extension
Structure of the zip file
A Job is a zip file containing these files and folders:
.
File/Folder | Description |
---|---|
assets | A folder that will contain all the files used for your job (xslt, templates...) |
assets/TESTS | A folder containing only the test files (for example when you need to test an xslt file with an input xml file) |
.jobignore | A file defining the files that must not be imported when the job is executed |
CHANGELOG.md | A markdown file where you should log every updates of your job |
job.json | A json file defining tasks that must be executed |
README.md | A markdown file where you should write about your job from a business point of view |
job.json
json
{
"schema": "1.0",
"key": "unique-job-key-in-your-account",
"title": "My job title",
"tasks": [],
}
1
2
3
4
5
6
2
3
4
5
6
json
{
"schema": "1.0",
"key": "unique-job-key-in-your-account",
"title": "My job title",
"icon": "file-add",
"titleLocal": {
"fra": "Le titre de mon job"
},
"description": "Description of the job",
"descriptionLocal": {
"fra": "La description du job"
},
"userInputs": [],
"tasks": [],
"outputParameters": {}
}
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
Property | Description |
---|---|
schema | Set 1.0 |
key | The unique key name of your job in your account |
title | The name that will be displayed to users |
icon | optional ENUM: the icon that will be displayed to users. Use the autocomplete in the vscode extension to get the full list |
titleLocal | optional An object for localization |
description | optional The description of the job |
descriptionLocal | optional An object for localization |
userInputs | optional A form of inputs that will be displayed to users |
tasks | An array of tasks |
outputParameters | optional Outputs that will be visible or downloadable from users |
Tasks
A task is a specific action, like getting files on a FTP, generate an .xlsx file... Each task has:
- Its own json representation.
- Input parameters
- Outputs.
Click this link to view all Tasks references. To learn more about how to wire inputs and outputs check the Wiring inputs and outputs tutorial.
User inputs
User inputs allows to display a form to a user when he execute a job. To add a user input use the autocompletion: use Ctrl + Space
or start typing user
after the title
property.
There is three types of user inputs.
User input: TEXT
json
{
"key": "catalog_name",
"title": "Catalog name",
"description": "The catalog name on the cover page",
"required": true,
"type": "TEXT",
"default": "New catalog"
}
1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
json
{
"key": "catalog_name",
"title": "Catalog name",
"titleLocal": {
"fra": "Nom du catalogue"
},
"description": "The catalog name on the cover page",
"descriptionLocal": {
"fra": "Le nom du catalogue affiché sur la page de garde"
},
"required": true,
"type": "TEXT",
"default": "New catalog"
}
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
Property | Description |
---|---|
key | A unique key in the job user inputs |
title | The title displayed to the user |
titleLocal | optional The localisation of the title |
description | optional The description displayed to the user |
descriptionLocal | optional The localisation of the description |
required | true |false defines if the field is mandatory |
type | Must be TEXT |
default | optional The default value |
User input: SELECT
json
{
"key": "export_language",
"title": "Select language",
"description": "Select the language of the exported catalog",
"required": true,
"mode":"SINGLE",
"type": "SELECT",
"options": [
{
"key": "fra",
"title": "French"
},
{
"key": "spa",
"title": "Spanish"
}
],
"default": "fra"
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
Property | Description |
---|---|
key | A unique key in the job user inputs |
title | The title displayed to the user |
description | optional The description displayed to the user |
required | true | false defines if the field is mandatory |
mode | optional Defines the number of options selectable. Must be SINGLE (default) | MULTIPLE |
type | Must be SELECT |
options | An array of options with key/title values |
default | optional The default value. Use the key of the option |
User input: FILE
json
{
"key": "zip_file",
"title": "Zip file",
"description": "Use a zip file with images at the root",
"required": true,
"type": "FILE",
}
1
2
3
4
5
6
7
2
3
4
5
6
7
Property | Description |
---|---|
key | A unique key in the job user inputs |
title | The title displayed to the user |
description | optional The description displayed to the user |
required | true |false defines if the field is mandatory |
type | Must be FILE |
The parameters passed by the user can be used in the job. To learn more view the User inputs tutorial.
The maximum allowed file size in user input is 2 Gb per file. (Note: the maximum upload time is set to 1 minute, so depending on the connection speed, the maximum size may vary)
Once uploaded, you can access to the following file properties in your job :
json
{
"input": {
"file": {
"id": "65819ba43ad5b963658ab35d",
"url": "https://asset.product-live.com/data-factory/633ec1f0829f993dedc288eb/download/70923562084497906fe165aa6ff2629f2d1e61d39d3e017709f7ac7722ddd2be",
"name": "my_zip_file.zip",
"hash": "70923562084497906fe165aa6ff2629f2d1e61d39d3e017709f7ac7722ddd2be",
"type": "file",
"key": "65819ba43ad5b963658ab35d",
"createdAt": "2024-04-22T13:43:21Z",
"updatedAt": "2024-04-22T13:43:21Z"
}
}
}
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
User outputs
User ouputs can be downloaded at the end of the execution of the job by the user who has executed the job, and are later available in the actions panel of the user.
They are defined by key/value, where the key can be any valid text, and value must be a valid output of a task. Example:
json
"outputParameters": {
"excel_files": "${file_generation_xlsx.output.files}",
"zip_files": "${file_generation_archive.output.files}"
}
1
2
3
4
2
3
4
To learn more view the User outputs tutorial.
Variables and secrets
It can be used to store:
- Values that can be set globally in your Jobs, like your brand name
- Protected content like login, password, tokens...
Variables are accessible with:
json
"${workflow.variable.variable_key}"
1
To learn more view the Variables and secrets tutorial.
Localisation
If you want to handle multiple languages for your job's title, click on All properties on job.json example above.
Available languages:
Arabic: ara
Chinese: zho
English: eng
French: fra
German: deu
Hindi: hin
Italian: ita
Japanese: jpn
Korean: kor
Dutch: nld
Portuguese: por
Russian: rus
Spanish: spa
Best pratice
Allways use the vs code extension to write your jobs.