Update a workflow
1 min
code examples curl request put \\ \ url https //api integrationmarketplace io/v1/{orgdomain}/environments/{envdomain}/workflows/{workflowid} \\ \ header 'accept application/json' \\ \ header 'content type application/json' \\ \ data '{ "title" "updated workflow title", "nodes" \[ { "id" "", "type" "query", "pack" "relias", "metadata" {} } ], "edges" \[ {} ], "packs" \[ { "id" "core", "version" "2 0 2" } ], "context" {} }'var myheaders = new headers(); myheaders append("accept", "application/json"); myheaders append("content type", "application/json"); var raw = json stringify({ "title" "updated workflow title", "nodes" \[ { "id" "", "type" "query", "pack" "relias", "metadata" {} } ], "edges" \[ {} ], "packs" \[ { "id" "core", "version" "2 0 2" } ], "context" {} }); var requestoptions = { method 'put', headers myheaders, body raw, redirect 'follow' }; fetch("https //api integrationmarketplace io/v1/{orgdomain}/environments/{envdomain}/workflows/{workflowid}", requestoptions) then(response => response text()) then(result => console log(result)) catch(error => console log('error', error));require "uri" require "json" require "net/http" url = uri("https //api integrationmarketplace io/v1/{orgdomain}/environments/{envdomain}/workflows/{workflowid}") https = net http new(url host, url port) https use ssl = true request = net http put new(url) request\["accept"] = "application/json" request\["content type"] = "application/json" request body = json dump({ "title" "updated workflow title", "nodes" \[ { "id" "", "type" "query", "pack" "relias", "metadata" {} } ], "edges" \[ {} ], "packs" \[ { "id" "core", "version" "2 0 2" } ], "context" {} }) response = https request(request) puts response read body import requests import json url = "https //api integrationmarketplace io/v1/{orgdomain}/environments/{envdomain}/workflows/{workflowid}" payload = json dumps({ "title" "updated workflow title", "nodes" \[ { "id" "", "type" "query", "pack" "relias", "metadata" {} } ], "edges" \[ {} ], "packs" \[ { "id" "core", "version" "2 0 2" } ], "context" {} }) headers = { 'accept' 'application/json', 'content type' 'application/json' } response = requests request("put", url, headers=headers, data=payload) print(response text) responses // workflow updated successfully { "id" "000a0000 a00a 00a0 a000 000000000000", "title" "my workflow", "description" "this workflow processes new hire onboarding ", "version" 1, "createdat" "2024 01 01t00 00 00z", "updatedat" "2024 01 01t00 00 00z", "nodes" \[ { "id" "", "type" "query", "pack" "relias", "description" "", "metadata" { "x" 0, "y" 0 }, "flow" { "nodes" \[ { "" "" } ], "edges" \[ { "src" { "id" "", "port" "out", "groups" \[ {} ] }, "tgt" { "id" "", "port" "in", "groups" \[ {} ] } } ] } } ], "edges" \[ { "src" { "id" "", "port" "out", "groups" \[ {} ] }, "tgt" { "id" "", "port" "in", "groups" \[ {} ] } } ], "packs" \[ { "id" "core", "version" "2 0 2" } ], "context" { "definitions" \[ {} ], "values" \[ { "definition id" "", "value" "" } ] } }// returned when the client request is malformed — the server can't process it due to missing or invalid input { "status" 400, "error" "bad request", "message" "invalid request parameters", "path" "/v1/{orgdomain}/environments", "timestamp" "2021 01 01t00 00 00z" }// returned when the request is well formed but access is denied due to invalid or expired credentials { "status" 400, "error" "bad request", "message" "invalid request parameters", "path" "/v1/{orgdomain}/environments", "timestamp" "2021 01 01t00 00 00z" }// returned when the authenticated user does not have the necessary permissions to access the requested resource { "status" 400, "error" "bad request", "message" "invalid request parameters", "path" "/v1/{orgdomain}/environments", "timestamp" "2021 01 01t00 00 00z" }// returned when the requested resource could not be found this can be due to an incorrect url or a resource that has been deleted { "status" 400, "error" "bad request", "message" "invalid request parameters", "path" "/v1/{orgdomain}/environments", "timestamp" "2021 01 01t00 00 00z" }// returned when the server encounters an unexpected error that prevents it from fulfilling the request { "status" 400, "error" "bad request", "message" "invalid request parameters", "path" "/v1/{orgdomain}/environments", "timestamp" "2021 01 01t00 00 00z" }