Schedules
Schedule a workflow
Run a workflow on a schedule.
POST
/
v1
/
workflows
/
{slug}
/
schedules
Schedule a workflow
curl --request POST \
--url https://api.valendata.com/v1/workflows/{slug}/schedules \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"cron": "<string>",
"every": "<string>",
"timezone": "UTC",
"inputs": {},
"enabled": true
}
'import requests
url = "https://api.valendata.com/v1/workflows/{slug}/schedules"
payload = {
"cron": "<string>",
"every": "<string>",
"timezone": "UTC",
"inputs": {},
"enabled": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
cron: '<string>',
every: '<string>',
timezone: 'UTC',
inputs: {},
enabled: true
})
};
fetch('https://api.valendata.com/v1/workflows/{slug}/schedules', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.valendata.com/v1/workflows/{slug}/schedules",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'cron' => '<string>',
'every' => '<string>',
'timezone' => 'UTC',
'inputs' => [
],
'enabled' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.valendata.com/v1/workflows/{slug}/schedules"
payload := strings.NewReader("{\n \"cron\": \"<string>\",\n \"every\": \"<string>\",\n \"timezone\": \"UTC\",\n \"inputs\": {},\n \"enabled\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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))
}HttpResponse<String> response = Unirest.post("https://api.valendata.com/v1/workflows/{slug}/schedules")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"cron\": \"<string>\",\n \"every\": \"<string>\",\n \"timezone\": \"UTC\",\n \"inputs\": {},\n \"enabled\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.valendata.com/v1/workflows/{slug}/schedules")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"cron\": \"<string>\",\n \"every\": \"<string>\",\n \"timezone\": \"UTC\",\n \"inputs\": {},\n \"enabled\": true\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"workflow_id": "<string>",
"workflow_slug": "<string>",
"enabled": true,
"frequency": "<string>",
"kind": "workflow",
"cron": "<string>",
"every": "<string>",
"timezone": "UTC",
"inputs": {},
"next_run_at": "<string>",
"last_run_at": "<string>",
"created_at": "<string>"
}{
"detail": "The request is malformed: the body is not JSON, the cursor or Idempotency-Key is not valid.",
"code": "invalid_json",
"type": "invalid_request_error",
"request_id": "3f9a1c2b7d4e"
}{
"detail": "The API key is missing, malformed, revoked, or expired.",
"code": "unauthorized",
"type": "authentication_error",
"request_id": "3f9a1c2b7d4e"
}{
"detail": "The key lacks a scope, is limited to other skills or workflows, or you may not do this.",
"code": "permission_denied",
"type": "permission_error",
"request_id": "3f9a1c2b7d4e"
}{
"detail": "It does not exist, or it is not yours to see.",
"code": "not_found",
"type": "invalid_request_error",
"request_id": "3f9a1c2b7d4e"
}{
"detail": "A conflict with the current state, or a request with this Idempotency-Key is still running.",
"code": "conflict",
"type": "conflict_error",
"request_id": "3f9a1c2b7d4e"
}{
"detail": "Invalid request — name: Field required",
"code": "validation_error",
"type": "invalid_request_error",
"request_id": "3f9a1c2b7d4e",
"param": "name",
"errors": [
{
"type": "missing",
"loc": [
"body",
"name"
],
"msg": "Field required"
}
]
}{
"detail": "Too many requests for this key, or too many runs in progress. Wait `Retry-After` seconds.",
"code": "rate_limited",
"type": "rate_limit_error",
"request_id": "3f9a1c2b7d4e"
}{
"detail": "Something broke on our side. Retry; runs that fail on our side are refunded.",
"code": "internal_error",
"type": "api_error",
"request_id": "3f9a1c2b7d4e"
}Takes
cron or every, timezone, inputs, and enabled, as in Schedule a skill, without max_results. inputs are checked against the workflow’s inputs.
A workflow has one schedule; a second gets 409 with its id.
Anyone who may edit the workflow (a viewer gets 403). Needs workflows:write, plus workflows:invoke to create it switched on. MCP tool: schedule_workflow.Authorizations
ApiKeyAuthApiKeyHeader
API key with the vd_sk_ prefix, as Authorization: Bearer vd_sk_.... Create keys in Settings → API Keys.
Headers
Any unique string (such as your order id). Resending the same request with the same key within 24 hours returns the first answer (with Idempotent-Replayed: true) and does nothing twice; the same key with a different request is a 422 idempotency_key_reused.
Required string length:
1 - 255Path Parameters
Body
application/json
A 5-field cron expression, e.g. '0 9 * * 1-5'.
Instead of cron: hourly, daily, weekly, daily:HH:MM, weekly:<mon..sun>:HH:MM, or an interval such as 15m, 2h, 1d (interval: also works).
IANA timezone the cron / time of day is in.
The inputs every scheduled run gets.
Response
The new schedule.
The canonical frequency, e.g. cron:0 9 * * 1 or daily:02:00.
⌘I
Schedule a workflow
curl --request POST \
--url https://api.valendata.com/v1/workflows/{slug}/schedules \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"cron": "<string>",
"every": "<string>",
"timezone": "UTC",
"inputs": {},
"enabled": true
}
'import requests
url = "https://api.valendata.com/v1/workflows/{slug}/schedules"
payload = {
"cron": "<string>",
"every": "<string>",
"timezone": "UTC",
"inputs": {},
"enabled": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
cron: '<string>',
every: '<string>',
timezone: 'UTC',
inputs: {},
enabled: true
})
};
fetch('https://api.valendata.com/v1/workflows/{slug}/schedules', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.valendata.com/v1/workflows/{slug}/schedules",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'cron' => '<string>',
'every' => '<string>',
'timezone' => 'UTC',
'inputs' => [
],
'enabled' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.valendata.com/v1/workflows/{slug}/schedules"
payload := strings.NewReader("{\n \"cron\": \"<string>\",\n \"every\": \"<string>\",\n \"timezone\": \"UTC\",\n \"inputs\": {},\n \"enabled\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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))
}HttpResponse<String> response = Unirest.post("https://api.valendata.com/v1/workflows/{slug}/schedules")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"cron\": \"<string>\",\n \"every\": \"<string>\",\n \"timezone\": \"UTC\",\n \"inputs\": {},\n \"enabled\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.valendata.com/v1/workflows/{slug}/schedules")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"cron\": \"<string>\",\n \"every\": \"<string>\",\n \"timezone\": \"UTC\",\n \"inputs\": {},\n \"enabled\": true\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"workflow_id": "<string>",
"workflow_slug": "<string>",
"enabled": true,
"frequency": "<string>",
"kind": "workflow",
"cron": "<string>",
"every": "<string>",
"timezone": "UTC",
"inputs": {},
"next_run_at": "<string>",
"last_run_at": "<string>",
"created_at": "<string>"
}{
"detail": "The request is malformed: the body is not JSON, the cursor or Idempotency-Key is not valid.",
"code": "invalid_json",
"type": "invalid_request_error",
"request_id": "3f9a1c2b7d4e"
}{
"detail": "The API key is missing, malformed, revoked, or expired.",
"code": "unauthorized",
"type": "authentication_error",
"request_id": "3f9a1c2b7d4e"
}{
"detail": "The key lacks a scope, is limited to other skills or workflows, or you may not do this.",
"code": "permission_denied",
"type": "permission_error",
"request_id": "3f9a1c2b7d4e"
}{
"detail": "It does not exist, or it is not yours to see.",
"code": "not_found",
"type": "invalid_request_error",
"request_id": "3f9a1c2b7d4e"
}{
"detail": "A conflict with the current state, or a request with this Idempotency-Key is still running.",
"code": "conflict",
"type": "conflict_error",
"request_id": "3f9a1c2b7d4e"
}{
"detail": "Invalid request — name: Field required",
"code": "validation_error",
"type": "invalid_request_error",
"request_id": "3f9a1c2b7d4e",
"param": "name",
"errors": [
{
"type": "missing",
"loc": [
"body",
"name"
],
"msg": "Field required"
}
]
}{
"detail": "Too many requests for this key, or too many runs in progress. Wait `Retry-After` seconds.",
"code": "rate_limited",
"type": "rate_limit_error",
"request_id": "3f9a1c2b7d4e"
}{
"detail": "Something broke on our side. Retry; runs that fail on our side are refunded.",
"code": "internal_error",
"type": "api_error",
"request_id": "3f9a1c2b7d4e"
}
