Creating a task with connections
Create a task and associate it with artifact parameters and connections using the Orchestration API.Before you begin
- Generate an access token:
- For users, generate a personal access token. For further information, see Generating a Personal Access Token.
- For service accounts, generate a service account token. For further information about how to generate a service account token, see Generating a service account token. Once generated, a service account token expires after 30 minutes. If it expires, generate a new token using the POST method at the endpoint
https://api.{env}.cloud.talend.com/security/oauth/token
.
- You must have the Author permission for the workspace where you want to create the task.
- You need the following IDs:
- workspaceId: The ID of your workspace.
- artifact.id and artifact.version: The artifact to use for the task.
- connections: IDs of the connections to link to the task.
- environmentId: The environment where the task will run.
About this task
In this example, Talend API Tester is used to issue API requests. For further information about Talend API Tester, see Talend Cloud API Tester User Guide.
Procedure
-
Open Talend API Tester in your browser and select POST from the Method list.
-
In the field next to the Method drop-down list, enter the endpoint to be used:
https://api.<your_data_center>.cloud.talend.com/orchestration/executables/tasks
-
In the HEADERS area, click Add header and in the name field, enter
Authorization
. In the value field, enterBearer <your_personal_access_token_or_service_account_token>
(with a whitespace after “Bearer”). -
In the BODY area, enter the task creation payload in JSON format. For example:
{ "workspaceId": "67b5e52a137c007b38831b60", "name": "GetWeatherFromAPI-2", "parameters": { "parameter_appid": "ap", "parameter_city": "ci" }, "artifact": { "id": "682205e502d7eb018b0bc636", "version": "0.1.3.20251205022952" }, "connections": { "restclient": "6822064013fd6c493407fafe" }, "environmentId": "67b5e52a137c007b38831b5f" }
- parameters: The user-defined context variables for the artifact associated with the task.
For further information about user-defined context variables, see User-defined variables.
For further information about how these parameters are defined in Talend Management Console, see Creating Job tasks. - connections and resources: Similarly, the context variables for connections and resources go to the connections and resources objects, respectively.
Resources are not used in this example.
- parameters: The user-defined context variables for the artifact associated with the task.
-
Click Send to issue your request.
The response contains the created task details with the status code
201
.
Results
You have created a new task with the specified artifact, parameters, and connections in the desired workspace and environment. You can now use this task ID to manage, schedule, or execute the task as needed.