Selector
Selector is a Pipe for conditional Pipeline branching. It checks conditions using JsonQL queries and routes the event to the corresponding pipe. If no condition is met, the event goes to outs.success (if it is defined).
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
outs | array | Yes | Array of conditions with target pipes |
Outs Array Element
| Field | Type | Required | Description |
|---|---|---|---|
query | string | Yes | JsonQL query returning true or false. Supports templating |
out | number | Yes | id of the pipe the event will go to when the condition is met |
Possible Errors
- Error processing
params.outs.query - JsonQL query execution error
Examples
Branching by Template Field
{
"id": 15,
"type": "selector",
"params": {
"outs": [
{
"query": "('$template.show_push' = 'true')",
"out": 102
},
{
"query": "('$template.show_push' = 'false')",
"out": 103
}
]
},
"outs": {
"success": 104,
"error": 105
}
}
Branching by API Response Status
{
"id": 15,
"type": "selector",
"params": {
"outs": [
{
"query": "('$in.data.status' = 'success')",
"out": 26
},
{
"query": "('$in.data.status' = 'error')",
"out": 27
}
]
},
"outs": {
"success": 28,
"error": 29
}
}