Launching Workflows Programmatically
To launch workflows programmatically, for example, in a Github Action, you can use the API endpoint at https://nucleus.latch.bio/sdk/wf
. The endpoint accepts a POST request with a JSON payload containing both the ID of the workflow as well as the parameter values to use when launching the workflow.
Prerequisites
The endpoint is authenticated using your SDK token (located in ~/.latch/token
). See instructions on how to set up your SDK token below:
- Make sure you’re in the workspace in which the workflow will be launched console.latch.bio
- Then go down to account settings on the bottom of the avatar menu.
- Then go to Developer > Access Tokens > API and copy the API key listed.
- Then on your local computer’s terminal open the file called
token
in the~/.latch
directory either throughvim ~/.latch/token
ornano ~/.latch/token
.
If the file does not exist, you can create it first by typing touch ~/.latch/token
.
- And then, paste the API key and save the file.
Launching a Workflow Using the curl
Endpoint
A curl
to the workflow’s endpoint would look like below:
Note: It is not recommended to construct this command manually. Instead, in the workflow parameters page in Latch Console, fill out the parameter values you would like to launch with, then copy the autogenerated command in the bottom of the right sidebar.
Was this page helpful?