Workflows
Clone a workflow
Creates a copy of an existing workflow with a new name.
POST
/
v1
/
workflows
/
{workflowID}
/
clone
Clone a workflow
curl --request POST \
--url https://api.strait.dev/v1/workflows/{workflowID}/clone \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"project_id": "<string>",
"slug": "<string>"
}
'import requests
url = "https://api.strait.dev/v1/workflows/{workflowID}/clone"
payload = {
"name": "<string>",
"project_id": "<string>",
"slug": "<string>"
}
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({name: '<string>', project_id: '<string>', slug: '<string>'})
};
fetch('https://api.strait.dev/v1/workflows/{workflowID}/clone', 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.strait.dev/v1/workflows/{workflowID}/clone",
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([
'name' => '<string>',
'project_id' => '<string>',
'slug' => '<string>'
]),
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.strait.dev/v1/workflows/{workflowID}/clone"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"project_id\": \"<string>\",\n \"slug\": \"<string>\"\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.strait.dev/v1/workflows/{workflowID}/clone")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"project_id\": \"<string>\",\n \"slug\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.strait.dev/v1/workflows/{workflowID}/clone")
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 \"name\": \"<string>\",\n \"project_id\": \"<string>\",\n \"slug\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"created_at": "2023-11-07T05:31:56Z",
"enabled": true,
"id": "<string>",
"name": "<string>",
"project_id": "<string>",
"slug": "<string>",
"steps": [
{
"created_at": "2023-11-07T05:31:56Z",
"depends_on": [
"<string>"
],
"id": "<string>",
"on_failure": "<string>",
"step_ref": "<string>",
"workflow_id": "<string>",
"approval_approvers": [
"<string>"
],
"approval_timeout_secs": 123,
"compensation_job_id": "<string>",
"compensation_timeout_secs": 123,
"concurrency_key": "<string>",
"condition": "<unknown>",
"cost_gate_default_action": "<string>",
"cost_gate_threshold_microusd": 123,
"cost_gate_timeout_secs": 123,
"event_emit_key": "<string>",
"event_key": "<string>",
"event_notify_url": "<string>",
"event_timeout_secs": 123,
"expected_duration_secs": 123,
"job_id": "<string>",
"max_nesting_depth": 123,
"output_transform": "<string>",
"payload": "<unknown>",
"resource_class": "<string>",
"retry_backoff": "<string>",
"retry_initial_delay_secs": 123,
"retry_max_attempts": 123,
"retry_max_delay_secs": 123,
"sleep_duration_secs": 123,
"stage_notifications": "<unknown>",
"step_type": "<string>",
"sub_workflow_id": "<string>",
"timeout_secs_override": 123
}
],
"updated_at": "2023-11-07T05:31:56Z",
"version": 123,
"$schema": "<string>",
"backwards_compatible": true,
"created_by": "<string>",
"cron": "<string>",
"cron_timezone": "<string>",
"description": "<string>",
"max_concurrent_runs": 123,
"max_parallel_steps": 123,
"skip_if_running": true,
"tags": {},
"timeout_secs": 123,
"updated_by": "<string>",
"version_id": "<string>",
"version_policy": "<string>"
}{
"$schema": "<string>",
"detail": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "<string>",
"status": 123,
"title": "<string>",
"type": "about:blank"
}{
"$schema": "<string>",
"detail": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "<string>",
"status": 123,
"title": "<string>",
"type": "about:blank"
}{
"$schema": "<string>",
"detail": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "<string>",
"status": 123,
"title": "<string>",
"type": "about:blank"
}{
"$schema": "<string>",
"detail": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "<string>",
"status": 123,
"title": "<string>",
"type": "about:blank"
}{
"$schema": "<string>",
"detail": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "<string>",
"status": 123,
"title": "<string>",
"type": "about:blank"
}{
"$schema": "<string>",
"detail": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "<string>",
"status": 123,
"title": "<string>",
"type": "about:blank"
}Authorizations
API key passed as Bearer token
Path Parameters
Response
OK
Show child attributes
Show child attributes
A URL to the JSON Schema for this object.
Example:
"https://api.strait.dev/schemas/WorkflowResponse.json"
Show child attributes
Show child attributes
⌘I
Clone a workflow
curl --request POST \
--url https://api.strait.dev/v1/workflows/{workflowID}/clone \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"project_id": "<string>",
"slug": "<string>"
}
'import requests
url = "https://api.strait.dev/v1/workflows/{workflowID}/clone"
payload = {
"name": "<string>",
"project_id": "<string>",
"slug": "<string>"
}
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({name: '<string>', project_id: '<string>', slug: '<string>'})
};
fetch('https://api.strait.dev/v1/workflows/{workflowID}/clone', 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.strait.dev/v1/workflows/{workflowID}/clone",
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([
'name' => '<string>',
'project_id' => '<string>',
'slug' => '<string>'
]),
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.strait.dev/v1/workflows/{workflowID}/clone"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"project_id\": \"<string>\",\n \"slug\": \"<string>\"\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.strait.dev/v1/workflows/{workflowID}/clone")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"project_id\": \"<string>\",\n \"slug\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.strait.dev/v1/workflows/{workflowID}/clone")
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 \"name\": \"<string>\",\n \"project_id\": \"<string>\",\n \"slug\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"created_at": "2023-11-07T05:31:56Z",
"enabled": true,
"id": "<string>",
"name": "<string>",
"project_id": "<string>",
"slug": "<string>",
"steps": [
{
"created_at": "2023-11-07T05:31:56Z",
"depends_on": [
"<string>"
],
"id": "<string>",
"on_failure": "<string>",
"step_ref": "<string>",
"workflow_id": "<string>",
"approval_approvers": [
"<string>"
],
"approval_timeout_secs": 123,
"compensation_job_id": "<string>",
"compensation_timeout_secs": 123,
"concurrency_key": "<string>",
"condition": "<unknown>",
"cost_gate_default_action": "<string>",
"cost_gate_threshold_microusd": 123,
"cost_gate_timeout_secs": 123,
"event_emit_key": "<string>",
"event_key": "<string>",
"event_notify_url": "<string>",
"event_timeout_secs": 123,
"expected_duration_secs": 123,
"job_id": "<string>",
"max_nesting_depth": 123,
"output_transform": "<string>",
"payload": "<unknown>",
"resource_class": "<string>",
"retry_backoff": "<string>",
"retry_initial_delay_secs": 123,
"retry_max_attempts": 123,
"retry_max_delay_secs": 123,
"sleep_duration_secs": 123,
"stage_notifications": "<unknown>",
"step_type": "<string>",
"sub_workflow_id": "<string>",
"timeout_secs_override": 123
}
],
"updated_at": "2023-11-07T05:31:56Z",
"version": 123,
"$schema": "<string>",
"backwards_compatible": true,
"created_by": "<string>",
"cron": "<string>",
"cron_timezone": "<string>",
"description": "<string>",
"max_concurrent_runs": 123,
"max_parallel_steps": 123,
"skip_if_running": true,
"tags": {},
"timeout_secs": 123,
"updated_by": "<string>",
"version_id": "<string>",
"version_policy": "<string>"
}{
"$schema": "<string>",
"detail": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "<string>",
"status": 123,
"title": "<string>",
"type": "about:blank"
}{
"$schema": "<string>",
"detail": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "<string>",
"status": 123,
"title": "<string>",
"type": "about:blank"
}{
"$schema": "<string>",
"detail": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "<string>",
"status": 123,
"title": "<string>",
"type": "about:blank"
}{
"$schema": "<string>",
"detail": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "<string>",
"status": 123,
"title": "<string>",
"type": "about:blank"
}{
"$schema": "<string>",
"detail": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "<string>",
"status": 123,
"title": "<string>",
"type": "about:blank"
}{
"$schema": "<string>",
"detail": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "<string>",
"status": 123,
"title": "<string>",
"type": "about:blank"
}