Create a new workspace trigger using XanoScript
Authentication: required
curl --request POST \
--url https://your-xano-instance.xano.io/api:meta/workspace/{workspace_id}/trigger \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: text/x-xanoscript' \
--data 'workspace_trigger foo {
input {
object to_branch? {
schema {
int id?
text label? filters=trim
}
}
object from_branch? {
schema {
int id?
text label? filters=trim
}
}
enum action {
values = ["branch_live", "branch_merge", "branch_new"]
}
}
stack {
var $x1 {
value = $input.score + 1
}
}
actions = {branch_live: true, branch_merge: true, branch_new: true}
}
'{
"id": 1,
"created_at": "2023-04-19 21:01:32+0000",
"updated_at": "2023-04-19 21:01:32+0000",
"name": "Workflow Trigger",
"description": "My workflow trigger test description",
"guid": "YE1fwVhQ-enRlc6Sb42Gqru58-0",
"branch": "v1",
"tag": [
"example tag"
],
"actions": {
"branch_live": true,
"branch_merge": true,
"branch_new": true
},
"xanoscript": {
"status": "ok",
"value": "<string>",
"message": "<string>"
}
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
The body is of type string.
"workspace_trigger foo {\n input {\n object to_branch? {\n schema {\n int id?\n text label? filters=trim\n }\n }\n object from_branch? {\n schema {\n int id?\n text label? filters=trim\n }\n }\n enum action {\n values = [\"branch_live\", \"branch_merge\", \"branch_new\"]\n }\n }\n stack {\n var $x1 {\n value = $input.score + 1\n }\n }\n actions = {branch_live: true, branch_merge: true, branch_new: true}\n}\n"
Success!
Show child attributes
Show child attributes
Was this page helpful?
curl --request POST \
--url https://your-xano-instance.xano.io/api:meta/workspace/{workspace_id}/trigger \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: text/x-xanoscript' \
--data 'workspace_trigger foo {
input {
object to_branch? {
schema {
int id?
text label? filters=trim
}
}
object from_branch? {
schema {
int id?
text label? filters=trim
}
}
enum action {
values = ["branch_live", "branch_merge", "branch_new"]
}
}
stack {
var $x1 {
value = $input.score + 1
}
}
actions = {branch_live: true, branch_merge: true, branch_new: true}
}
'{
"id": 1,
"created_at": "2023-04-19 21:01:32+0000",
"updated_at": "2023-04-19 21:01:32+0000",
"name": "Workflow Trigger",
"description": "My workflow trigger test description",
"guid": "YE1fwVhQ-enRlc6Sb42Gqru58-0",
"branch": "v1",
"tag": [
"example tag"
],
"actions": {
"branch_live": true,
"branch_merge": true,
"branch_new": true
},
"xanoscript": {
"status": "ok",
"value": "<string>",
"message": "<string>"
}
}