{
"apiVersion": "zebflow.com/v1",
"kind": "Pipeline",
"metadata": {
"name": "tg-send-photo"
},
"spec": {
"id": "tg-send-photo",
"nodes": [
{
"id": "trigger",
"kind": "n.trigger.function",
"config": {},
"input_pins": [],
"output_pins": [
"out"
]
},
{
"id": "prepare",
"kind": "n.script",
"config": {
"source": "var body = { chat_id: String(input.chat_id), photo: String(input.photo) }; if (input.caption) body.caption = String(input.caption); if (input.parse_mode) body.parse_mode = String(input.parse_mode); if (input.disable_notification) body.disable_notification = true; return body;"
},
"input_pins": [
"in"
],
"output_pins": [
"out"
]
},
{
"id": "send",
"kind": "n.http.request",
"config": {
"method": "POST",
"url": "https://api.telegram.org/bot{{ $placeholder.BOT_TOKEN }}/sendPhoto",
"headers": {
"Content-Type": "application/json"
},
"body": "{{ input }}",
"response_type": "json"
},
"input_pins": [
"in"
],
"output_pins": [
"out"
]
}
],
"edges": [
{
"from_node": "trigger",
"from_pin": "out",
"to_node": "prepare",
"to_pin": "in"
},
{
"from_node": "prepare",
"from_pin": "out",
"to_node": "send",
"to_pin": "in"
}
]
}
}