Wrkflow Launch API

How to launch a Wrkflow via API

David Li avatar
Written by David Li
Updated over a week ago

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 in your Wrkflow management page. Find the Wrkflow you want to trigger by API and click 'show more' to see the UUID.

Parameters

Header

Authorization: API-Key <API key>

"Authorization": "Api-Key Kdjan23fDADFaHrji134jaDjfiakjdf=fdjie23kgaSdjkgidja"

Content-Type

(only required when sending file(s) via the API)

"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.

{ "short": "6613529", "HubSpot account": "33f26cf3-8032-41ac-9c71-7f95d7aac6ad" }

start_date

No

string

Date and time where launched wrkflow become available. The launch is start immediate if a start date is not provided.

"2021-01-01T00:00:00.000Z"

end_date

No

string

Date time where launched wrkflow jobs expire. The launch is continue until completed if an end date is not provided.

"2021-02-01T00:00:00.000Z"

priority

No

int

1 - High Priority: Higher cost

2 - Medium Priority (default)

3- Low Priority: Lower cost

2

Example of a JSON Body

{
"wrkflow_uuid": "44487ec0-b6c2-46b4-8fae-32fe3e030dc2",
"name": "An optional name for your Launch",
"values": {
"Email": "john@wrk.com",
"Company Crunchbase URL": "https://www.crunchbase.com/organization/wrk-c8d8"
}
}

The properties under values are the names of the fields in the Wrkflow Launch form. The fields in the launch form below is represented in the JSON Body under values.

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

{ "ok": True, }

Wrkflow launch successful

400

{ "ok": False, "error": "Invalid launch wrkflow request", }

Invalid request body (ex. missing wrkflow_uuid)

Invalid launch wrkflow request (ex. provided wrkflow_uuid doesn’t exist)

400

{ "ok": False, "error": "Cannot run disabled wrkflow ID {ID}", }

Attempting to run a disabled wrkflow.

403

{ "detail": "Authentication credentials were not provided." }

Invalid API Key used in Authorization header.

Missing API Key in Authorization header.

403

{ "ok": False, "error": "Insufficient permissions to launch wrkflow", }

Insufficient permissions to launch wrkflow. Unable to find valid account associated with API key.

404

{ "ok": False, "error": "No wrkflows found", }

Unable to find requested wrkflow for client.

500

{ "ok": False, "error": {error message}, }

Generic catch all response due to error. Most likely due to error in gRPC call.

429

{ "detail": "Request was throttled. Expected available in {number} seconds." }

Request has been throttled. Response body will inform of how much time before throttling lifted.

Did this answer your question?