Jobs
Requirement
- Complete the Create my first job tutorial.
- Install the VS Code extension.
Structure of the ZIP File
A job is a ZIP file containing the following files and folders:
.
File/Folder | Description |
---|---|
assets | Contains all files used for your job (e.g., XSLT, templates). |
assets/TESTS | Contains test files (e.g., input XML files for testing XSLT). |
.jobignore | Specifies files that should not be included in the ZIP file when generating it. |
CHANGELOG.md | A markdown file to log updates to your job. |
job.json | A JSON file defining tasks to execute. |
README.md | A markdown file describing your job. |
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 to 1.0 |
key | Unique key for your job in your account |
title | Display name for users |
icon | ENUM: Icon displayed to users. Use VS Code extension autocomplete for the full list |
titleLocal | Localization object for the title. |
description | Job description. |
descriptionLocal | Localization object for the description. |
userInputs | Form inputs displayed to users |
tasks | Array of tasks. |
outputParameters | Outputs of the current job. These outputs are made available in the settings.product-live.com interface |
Tasks
A task represents a specific action, such as retrieving files from an FTP server or generating an .xlsx file.
Refer to the Tasks documentation for details. Learn about wiring inputs and outputs in the Wiring Inputs and Outputs tutorial.
User Inputs
User inputs allow you to display a form to users when they execute a job. To add a user input, use autocompletion: press Ctrl + Space
or type user
after the title
property.
There are 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 | Unique key for the user input. |
title | Title displayed to the user. |
titleLocal | Localization for the title. |
description | Description displayed to the user. |
descriptionLocal | Localization for the description. |
required | true |false to indicate if the field is mandatory. |
type | Must be TEXT |
default | 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 | Unique key for the user input |
title | Title displayed to the user |
description | Description displayed to the user |
required | true |false to indicate if the field is mandatory |
mode | Number of selectable options: SINGLE (default) | MULTIPLE |
type | Must be SELECT |
options | Array of options with key/title pairs |
default | 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 | Unique key for the user input. |
title | Title displayed to the user. |
description | Description displayed to the user. |
required | true |false to indicate if the field is mandatory. |
type | Must be FILE . |
User-provided parameters can be used in the job. Learn more in the User Inputs tutorial.
The maximum file size for user input is 2 GB per file. Note: Upload time is limited to 1 minute, so the maximum size may vary depending on connection speed.
Once uploaded, the following file properties are accessible 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 outputs can be downloaded after job execution and are available in the user's actions panel. Define them as key-value pairs, where the key is any valid text, and the value is a valid task output. Example:
json
"outputParameters": {
"excel_files": "${file_generation_xlsx.output.files}",
"zip_files": "${file_generation_archive.output.files}"
}
1
2
3
4
2
3
4
Learn more in the User Outputs tutorial.
Variables and Secrets
Use variables and secrets to store:
- Global values for your jobs, such as a brand name.
- Protected content like login credentials, passwords, or tokens.
Access variables using:
json
"${workflow.variable.variable_key}"
1
Learn more in the Variables and Secrets tutorial.
Localization
To support multiple languages for your job's title, refer to the "All Properties" example in the job.json section.
Supported 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 Practice
Always use the VS Code extension to create your jobs.