Workflows
Create a flow
Create a new empty flow in draft state. Configure it (trigger, actions) and publish before enabling.
POST
/
v1
/
workflow
/
Create a flow
import requests
url = "https://api.diga.io/v1/workflow/"
payload = { "name": "<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>'})
};
fetch('https://api.diga.io/v1/workflow/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://api.diga.io/v1/workflow/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>"
}
'package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.diga.io/v1/workflow/"
payload := strings.NewReader("{\n \"name\": \"<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))
}{
"id": "<string>",
"created": "2023-11-07T05:31:56Z",
"updated": "2023-11-07T05:31:56Z",
"name": "<string>",
"status": "ENABLED",
"flow_category": "post_call",
"trigger": {
"name": "<string>",
"type": "<string>",
"valid": true,
"displayName": "<string>",
"settings": {
"pieceName": "<string>",
"pieceVersion": "<string>",
"triggerName": "<string>",
"input": {},
"propertySettings": {},
"sampleData": {}
},
"nextAction": {
"name": "<string>",
"type": "<string>",
"valid": true,
"displayName": "<string>",
"skip": true,
"settings": {
"pieceName": "<string>",
"pieceVersion": "<string>",
"actionName": "<string>",
"triggerName": "<string>",
"input": {},
"propertySettings": {},
"sampleData": {},
"branches": [
{}
],
"executionType": "<string>",
"sourceCode": {}
},
"children": [
"<unknown>"
],
"nextAction": null
}
},
"produced_variables": [
"<string>"
],
"consumed_variables": [
"<string>"
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Autorizaciones
Cuerpo
application/json
Respuesta
Successful Response
Flow response.
⌘I
Create a flow
import requests
url = "https://api.diga.io/v1/workflow/"
payload = { "name": "<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>'})
};
fetch('https://api.diga.io/v1/workflow/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://api.diga.io/v1/workflow/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>"
}
'package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.diga.io/v1/workflow/"
payload := strings.NewReader("{\n \"name\": \"<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))
}{
"id": "<string>",
"created": "2023-11-07T05:31:56Z",
"updated": "2023-11-07T05:31:56Z",
"name": "<string>",
"status": "ENABLED",
"flow_category": "post_call",
"trigger": {
"name": "<string>",
"type": "<string>",
"valid": true,
"displayName": "<string>",
"settings": {
"pieceName": "<string>",
"pieceVersion": "<string>",
"triggerName": "<string>",
"input": {},
"propertySettings": {},
"sampleData": {}
},
"nextAction": {
"name": "<string>",
"type": "<string>",
"valid": true,
"displayName": "<string>",
"skip": true,
"settings": {
"pieceName": "<string>",
"pieceVersion": "<string>",
"actionName": "<string>",
"triggerName": "<string>",
"input": {},
"propertySettings": {},
"sampleData": {},
"branches": [
{}
],
"executionType": "<string>",
"sourceCode": {}
},
"children": [
"<unknown>"
],
"nextAction": null
}
},
"produced_variables": [
"<string>"
],
"consumed_variables": [
"<string>"
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}
