Trigger a workflow run
curl --request POST \
--url https://api.metal.ai/v1/workflows/{id}/runs \
--header 'Content-Type: application/json' \
--header 'x-metal-api-key: <api-key>' \
--header 'x-metal-client-id: <api-key>' \
--data '{
"input": {}
}'import requests
url = "https://api.metal.ai/v1/workflows/{id}/runs"
payload = { "input": {} }
headers = {
"x-metal-client-id": "<api-key>",
"x-metal-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-metal-client-id': '<api-key>',
'x-metal-api-key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({input: {}})
};
fetch('https://api.metal.ai/v1/workflows/{id}/runs', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.metal.ai/v1/workflows/{id}/runs"
payload := strings.NewReader("{\n \"input\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-metal-client-id", "<api-key>")
req.Header.Add("x-metal-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"data": {
"id": "665f1c2a9b1e4a0012a3b4c6",
"workflowId": "665f1c2a9b1e4a0012a3b4c5",
"status": "running",
"input": {},
"output": {},
"createdAt": "2023-11-07T05:31:56Z",
"completedAt": "2023-11-07T05:31:56Z"
}
}{
"error": "Invalid request body"
}{
"error": "invalid api key or clientId"
}{
"error": "not found"
}Trigger a workflow run
Starts a new run of the workflow with the provided input. Runs are asynchronous; poll the run to track completion.
POST
/
v1
/
workflows
/
{id}
/
runs
Trigger a workflow run
curl --request POST \
--url https://api.metal.ai/v1/workflows/{id}/runs \
--header 'Content-Type: application/json' \
--header 'x-metal-api-key: <api-key>' \
--header 'x-metal-client-id: <api-key>' \
--data '{
"input": {}
}'import requests
url = "https://api.metal.ai/v1/workflows/{id}/runs"
payload = { "input": {} }
headers = {
"x-metal-client-id": "<api-key>",
"x-metal-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-metal-client-id': '<api-key>',
'x-metal-api-key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({input: {}})
};
fetch('https://api.metal.ai/v1/workflows/{id}/runs', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.metal.ai/v1/workflows/{id}/runs"
payload := strings.NewReader("{\n \"input\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-metal-client-id", "<api-key>")
req.Header.Add("x-metal-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"data": {
"id": "665f1c2a9b1e4a0012a3b4c6",
"workflowId": "665f1c2a9b1e4a0012a3b4c5",
"status": "running",
"input": {},
"output": {},
"createdAt": "2023-11-07T05:31:56Z",
"completedAt": "2023-11-07T05:31:56Z"
}
}{
"error": "Invalid request body"
}{
"error": "invalid api key or clientId"
}{
"error": "not found"
}Authorizations
The Client ID of your API key.
The secret value of your API key.
Path Parameters
The workflow id.
Body
application/json
The input payload the workflow expects.
Response
The created run.
Show child attributes
Show child attributes

