Overview
On the Wrk platform, Wrkflows can be launched through an API for seamless integration with other systems. The Wrkflow Launch endpoint perform multiple or launches for any Wrkflow in your account.
Endpoint
POST https://account.wrk.com/api/trigger/launch/
Requirements
API key
Wrkflow UUID
Limits: 1000 requests / day
API Key
An API key is a unique identifier used to authenticate and authorize a user to use the API to launch Wrkflows to your account. You can obtain the API key from this page or by clicking on the top right menu > API key.
The API key is unique to your account but it is shared for all Wrkflows within the account. i.e. the same API key can be used to launch different Wrkflows within the same account.
Warning: Sharing an API Key with another user or a 3rd party means you are allowing them to launch and potentially incur cost directly to your account. Only share with those you trust and when necessary.
Once in the page, you can click on 'Regenerate Key' if you never generated an API key before and the key will be shown in the indicated field. You may need to click on the eye icon for the key to become readable. Keep a copy of your API key in a safe place if necessary. You will be able to view the generated API key again in the future by visiting the page again and clicking on the eye icon.
Warning: In the event that your API key has been compromised or you wish to change the API key to prevent anyone that has a copy of your API key to use it - you can use the 'Regenerate Key' again and the system will invalidate any previous API key. Only one API key will work at a time and only the latest generated API key will be valid. Once regenerated, any API requests made with an older key will fail.
Wrkflow UUID
The Wrkflow UUID is a unique identifier for a Wrkflow and allows the launch API to know which Wrkflow to launch. You can find the Wrkflow UUID next to the label 'API Launch: UUID' in your Wrkflow management page (see below).
Parameters
Header | Authorization: API-Key <API key> | "Authorization": "Api-Key Kdjan23fDADFaHrji134jaDjfiakjdf=fdjie23kgaSdjkgidja" |
| Content-Type | "Content-Type":"application/json" |
| Content-Type Only required when sending file(s) via the API. To replace | "Content-Type":"multipart/form-data; boundary=<calculated when request is sent>" |
Body | JSON Field | See section below |
Body
Parameters | Required | Type | Description | Example |
wrkflow_uuid | Yes | string | Global uuid Wrkflow identification | "e48b6072-741e-4189-86e4-e01e243b0e87" |
name | No | string | Name of the Wrkflow launch. A default name will be generated if not provided. | “The name of the run” |
values | No | JSON (key value pairs) | Key value pairs used to provide data to launch config values. |
|
priority | No | int | 1 - High Priority: Higher cost 2 - Medium Priority (default) 3- Low Priority: Lower cost | 2 |
Example of a JSON Body
{
|
The properties under
|
File Upload
In the event that the Wrfklow is expecting one or more files for launch, you can include them in the body.
Note that you will need to set the Content-Type
in the header to upload file(s).
Response
Status | Response Body | Description |
200
|
| Wrkflow launch successful A Launch ID is returned as wrkflowRunId |
400 |
| Invalid request body (ex. missing wrkflow_uuid) Invalid launch wrkflow request (ex. provided wrkflow_uuid doesn’t exist) |
400 |
| Attempting to run a disabled wrkflow. |
403 |
| Invalid API Key used in Authorization header. Missing API Key in Authorization header. |
403 |
| Insufficient permissions to launch wrkflow. Unable to find valid account associated with API key. |
404 |
| Unable to find requested wrkflow for client. |
500 |
| Generic catch all response due to error. Most likely due to error in gRPC call. |
429 |
| Request has been throttled. Response body will inform of how much time before throttling lifted. |