Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- "description": "General-flow",
- "states": [
- {
- "name": "Trigger",
- "type": "InitialState",
- "properties": {
- "offset": {
- "x": -280,
- "y": 0
- },
- "flow_url": "https://webhooks.twilio.com/v1/Accounts/ACb5e15506e866d738558cae73adc6f636/Flows/FWb0013e4ad67bf00e1866976afa513276"
- },
- "transitions": [
- {
- "event": "incomingMessage",
- "conditions": [],
- "next": "FFd7cbb252355a62accea2295484c8a272",
- "uuid": "d0c6e880-9fee-4666-8584-3b831f07b5c7"
- },
- {
- "event": "incomingCall",
- "conditions": [],
- "next": null,
- "uuid": "2f98286e-4821-4187-8a6d-04a78b34b95c"
- },
- {
- "event": "incomingRequest",
- "conditions": [],
- "next": "FF17ada6535c4c15c1f605510940d61676",
- "uuid": "f50b9ff5-daf0-4ecb-aed4-1c795afa0c5b"
- }
- ],
- "sid": "FFe6982cf50f5b5c0ef41af566462c0cde"
- },
- {
- "name": "v_set_variables",
- "type": "SetVariables",
- "properties": {
- "offset": {
- "x": -10,
- "y": 170
- },
- "variables": [
- {
- "key": "current",
- "value": "{{widgets.v_set_variables.Variables.current}}",
- "index": "0"
- },
- {
- "key": "reply",
- "value": "{{widgets.reply.inbound.Body}}",
- "index": "1"
- },
- {
- "key": "previous",
- "value": "start"
- },
- {
- "key": "steps",
- "value": "{{ flow.data.steps | to_json }}"
- },
- {
- "key": "state",
- "value": "{{flow.data.state | to_json }}",
- "index": "4"
- },
- {
- "key": "replies",
- "value": ":>>",
- "index": "5"
- }
- ]
- },
- "transitions": [
- {
- "event": "next",
- "conditions": [],
- "next": "FF517d06ea3d1db7e2505071488aa719df",
- "uuid": "0d42e925-9573-4a6e-9df1-ace8a5d84eeb"
- }
- ],
- "sid": "FF17ada6535c4c15c1f605510940d61676"
- },
- {
- "name": "f_load_next",
- "type": "Function",
- "properties": {
- "offset": {
- "x": -10,
- "y": 380
- },
- "url": "https://studio-helpers-4924-prod.twil.io/process-next",
- "timeout": null,
- "parameters": [
- {
- "key": "variables",
- "value": "{{flow.variables | to_json}}"
- }
- ],
- "service_sid": "ZS3cc3d0fd33783728ce19a8a832b1d0b7",
- "function_sid": "ZNc5843c4b3104b723307fd94f1ebdbeb2",
- "environment_sid": "ZE37b748efa9f8450169885eb99c673e1e"
- },
- "transitions": [
- {
- "event": "success",
- "conditions": [],
- "next": "FF674c3e656409e901dd03086d2b11d343",
- "uuid": "62a5d8ee-b873-455d-b5da-32f48a62dfc9"
- },
- {
- "event": "fail",
- "conditions": [],
- "next": null,
- "uuid": "94dac718-d0ff-43d8-a5b7-646e9220b978"
- }
- ],
- "sid": "FF517d06ea3d1db7e2505071488aa719df"
- },
- {
- "name": "v_update_context",
- "type": "SetVariables",
- "properties": {
- "offset": {
- "x": -10,
- "y": 590
- },
- "variables": [
- {
- "key": "previous",
- "value": "{{flow.variables.current}}"
- },
- {
- "value": "{{widgets.f_load_next.parsed.next}}",
- "key": "current",
- "index": "1"
- },
- {
- "key": "reply",
- "value": "_"
- },
- {
- "key": "catch_text",
- "value": "{{widgets.f_load_next.parsed.catchText}}"
- }
- ]
- },
- "transitions": [
- {
- "event": "next",
- "conditions": [],
- "next": "FF5bfd99cc95db639e12564e4fd4b44e92",
- "uuid": "fd17c587-f76a-43b3-8f50-fe246e7376ca"
- }
- ],
- "sid": "FF674c3e656409e901dd03086d2b11d343"
- },
- {
- "name": "s_solve_next",
- "type": "Branch",
- "properties": {
- "offset": {
- "x": -10,
- "y": 790
- },
- "input": "{{widgets.f_load_next.parsed.block.type}}"
- },
- "transitions": [
- {
- "event": "noMatch",
- "conditions": [],
- "next": "FF0dad89e568cc23690e859d5b36816d25",
- "uuid": "8a2f901a-8aca-4776-8ba1-9d5643ee81b7"
- },
- {
- "event": "match",
- "conditions": [
- {
- "friendly_name": "If value equal_to reply",
- "type": "equal_to",
- "arguments": [
- "{{widgets.f_load_next.parsed.block.type}}"
- ],
- "value": "reply"
- }
- ],
- "next": "FF4ab59e198c267b7b3104c2a4eb3f5d98",
- "uuid": "c50f4bbd-ed41-4ff9-9e1c-efb7773632b1"
- },
- {
- "event": "match",
- "conditions": [
- {
- "friendly_name": "If value equal_to basic",
- "type": "equal_to",
- "arguments": [
- "{{widgets.f_load_next.parsed.block.type}}"
- ],
- "value": "basic"
- }
- ],
- "next": "FF73e51f5a7cf4f9b627e90a7f51542488",
- "uuid": "fced5388-f866-416a-b0f5-d001bdb85760"
- },
- {
- "event": "match",
- "conditions": [
- {
- "friendly_name": "If value equal_to catchAll",
- "type": "equal_to",
- "arguments": [
- "{{widgets.f_load_next.parsed.block.type}}"
- ],
- "value": "catch_all"
- }
- ],
- "next": "FF36accfa4daaffe00163b0bc7a21b9bef",
- "uuid": "30c4e121-f02c-48fb-8a42-b1fa4f2cab38"
- },
- {
- "event": "match",
- "conditions": [
- {
- "friendly_name": "If value equal_to timeout",
- "type": "equal_to",
- "arguments": [
- "{{widgets.f_load_next.parsed.block.type}}"
- ],
- "value": "timeout"
- }
- ],
- "next": "FF6c2c9ad0f0a45dd25473f72e733556bf",
- "uuid": "f8429630-64b2-4936-8630-fc79c4af8b97"
- },
- {
- "event": "match",
- "conditions": [
- {
- "friendly_name": "If value equal_to webhook",
- "type": "equal_to",
- "arguments": [
- "{{widgets.f_load_next.parsed.block.type}}"
- ],
- "value": "webhook"
- }
- ],
- "next": "FFf4ffb1f68de0eb3b556115367a6b14bb",
- "uuid": "bd36463e-3c72-4490-a4c7-0137726bcbfd"
- }
- ],
- "sid": "FF5bfd99cc95db639e12564e4fd4b44e92"
- },
- {
- "name": "reply",
- "type": "MessagePrompt",
- "properties": {
- "offset": {
- "x": -770,
- "y": 1290
- },
- "body": "{{widgets.f_load_next.parsed.block.text}}",
- "from": "{{flow.channel.address}}",
- "timeout": 3600,
- "save_response_as": null,
- "media_url": "{{widgets.f_load_next.parsed.block.image}}",
- "service": "{{trigger.message.InstanceSid}}",
- "channel": "{{trigger.message.ChannelSid}}",
- "attributes": null
- },
- "transitions": [
- {
- "event": "incomingMessage",
- "conditions": [],
- "next": "FF8624e33a96597460ed4c15f6a8deaa61",
- "uuid": "4ee34dea-281e-4d9b-ac25-e97a35c3e600"
- },
- {
- "event": "timeout",
- "conditions": [],
- "next": null,
- "uuid": "364f3bff-d91e-42b8-a336-c7d3b5fb8585"
- },
- {
- "event": "deliveryFailure",
- "conditions": [],
- "next": null,
- "uuid": "0abd4a2b-9651-41be-bf4a-e203db363f04"
- }
- ],
- "sid": "FFe87549d85fe468441e6d9d40bde711a0"
- },
- {
- "name": "f_check_status",
- "type": "Function",
- "properties": {
- "offset": {
- "x": 60,
- "y": 1300
- },
- "url": "https://studio-helpers-4924-prod.twil.io/check-message",
- "timeout": null,
- "parameters": [
- {
- "key": "sid",
- "value": "{{widgets.f_basic.parsed.sid}}"
- }
- ],
- "service_sid": "ZS3cc3d0fd33783728ce19a8a832b1d0b7",
- "function_sid": "ZNe038a7175e500da4cc4ee112070f81a1",
- "environment_sid": "ZE37b748efa9f8450169885eb99c673e1e"
- },
- "transitions": [
- {
- "event": "success",
- "conditions": [],
- "next": "FF0fc2bae7f55d696ef07e274960fd81d8",
- "uuid": "038c74f7-8dc0-4dce-8305-5f8966d6d168"
- },
- {
- "event": "fail",
- "conditions": [],
- "next": null,
- "uuid": "54836cea-6146-49d0-96a2-565b47ee5801"
- }
- ],
- "sid": "FF9cb83333155542f2882d03dcf353b1cf"
- },
- {
- "name": "f_basic",
- "type": "Function",
- "properties": {
- "offset": {
- "x": 50,
- "y": 1100
- },
- "url": "https://studio-helpers-4924-prod.twil.io/send-message",
- "timeout": null,
- "parameters": [
- {
- "key": "to",
- "value": "{{contact.channel.address}}"
- },
- {
- "key": "from",
- "value": "{{flow.channel.address}}"
- },
- {
- "key": "resource",
- "value": "{{widgets.f_load_next.parsed.block.image}}"
- },
- {
- "key": "text",
- "value": "{{widgets.f_load_next.parsed.block.text}}"
- }
- ],
- "service_sid": "ZS3cc3d0fd33783728ce19a8a832b1d0b7",
- "function_sid": "ZNe38c8dc84409e3db4e6a6c10020c93a0",
- "environment_sid": "ZE37b748efa9f8450169885eb99c673e1e"
- },
- "transitions": [
- {
- "event": "success",
- "conditions": [],
- "next": "FF9cb83333155542f2882d03dcf353b1cf",
- "uuid": "0b1cdd98-9dde-41b3-b73c-34731e433089"
- },
- {
- "event": "fail",
- "conditions": [],
- "next": null,
- "uuid": "12a88b12-eb66-4f94-8f02-2b98fc06e2b6"
- }
- ],
- "sid": "FF73e51f5a7cf4f9b627e90a7f51542488"
- },
- {
- "name": "s_check_status_loop",
- "type": "Branch",
- "properties": {
- "offset": {
- "x": 60,
- "y": 1470
- },
- "input": "{{widgets.f_check_status.parsed.status}}"
- },
- "transitions": [
- {
- "event": "noMatch",
- "conditions": [],
- "next": "FF9cb83333155542f2882d03dcf353b1cf",
- "uuid": "961c16d1-1403-46b8-bf1a-e3f8943b71e8"
- },
- {
- "event": "match",
- "conditions": [
- {
- "friendly_name": "If value equal_to delivered,sent",
- "type": "matches_any_of",
- "arguments": [
- "{{widgets.f_check_status.parsed.status}}"
- ],
- "value": "delivered,sent,Delivered,Sent"
- }
- ],
- "next": "FF517d06ea3d1db7e2505071488aa719df",
- "uuid": "020c8dce-5c0f-40ca-b66b-9775a05f2b3d"
- }
- ],
- "sid": "FF0fc2bae7f55d696ef07e274960fd81d8"
- },
- {
- "name": "v_set_reply",
- "type": "SetVariables",
- "properties": {
- "offset": {
- "x": -480,
- "y": 1550
- },
- "variables": [
- {
- "key": "reply",
- "value": "{% if widgets.reply.inbound.Body %}{{widgets.reply.inbound.Body}}{% else %}{{widgets.reply_text.inbound.Body}}{% endif %}",
- "index": "0"
- }
- ]
- },
- "transitions": [
- {
- "event": "next",
- "conditions": [],
- "next": "FF3831d850e46aec3d116f6fbb15f48f55",
- "uuid": "19e2849b-a4cd-40d4-a7a5-e9cc54a1faf7"
- }
- ],
- "sid": "FF8624e33a96597460ed4c15f6a8deaa61"
- },
- {
- "name": "catch_all",
- "type": "MessagePrompt",
- "properties": {
- "offset": {
- "x": 500,
- "y": 1100
- },
- "body": "{{flow.variables.catch_text}}",
- "from": "{{flow.channel.address}}",
- "timeout": 3600,
- "save_response_as": null,
- "media_url": null,
- "service": "{{trigger.message.InstanceSid}}",
- "channel": "{{trigger.message.ChannelSid}}",
- "attributes": null
- },
- "transitions": [
- {
- "event": "incomingMessage",
- "conditions": [],
- "next": "FF2e5d82ad368f173d17be97b876beeb58",
- "uuid": "bfec30a6-d38d-44e1-b548-233b6adeb253"
- },
- {
- "event": "timeout",
- "conditions": [],
- "next": null,
- "uuid": "e3893bbe-06f0-4c5e-be0b-d395b8afd349"
- },
- {
- "event": "deliveryFailure",
- "conditions": [],
- "next": null,
- "uuid": "20623686-cf63-402d-9aed-42baa8ffb9f7"
- }
- ],
- "sid": "FF36accfa4daaffe00163b0bc7a21b9bef"
- },
- {
- "name": "v_set_catch_reply",
- "type": "SetVariables",
- "properties": {
- "offset": {
- "x": 500,
- "y": 1490
- },
- "variables": [
- {
- "key": "reply",
- "value": "{{widgets.catch_all.inbound.Body}}"
- },
- {
- "value": "{{ flow.variables.previous}}",
- "key": "current",
- "index": "1"
- }
- ]
- },
- "transitions": [
- {
- "event": "next",
- "conditions": [],
- "next": "FF3831d850e46aec3d116f6fbb15f48f55",
- "uuid": "55de054b-9f5c-4ae1-988e-051a5cc1a65f"
- }
- ],
- "sid": "FF2e5d82ad368f173d17be97b876beeb58"
- },
- {
- "name": "http_schedule_timeout",
- "type": "Webhook",
- "properties": {
- "offset": {
- "x": 870,
- "y": 1120
- },
- "method": "POST",
- "url": "https://app.omsg.io/api/conversations/schedule",
- "body": "{\n \"executionId\": \"{{flow.sid}}\",\n \"state\": {\n \"current\": \"{{widgets.f_load_next.parsed.block.next}}\"\n },\n\"schedule\": \"{{widgets.f_load_next.parsed.block.schedule}}\"\n}",
- "timeout": null,
- "parameters": null,
- "save_response_as": null,
- "content_type": "application/json;charset=utf-8"
- },
- "transitions": [
- {
- "event": "success",
- "conditions": [],
- "next": null,
- "uuid": "00687b96-8772-4a91-9a0b-36df79767cb5"
- },
- {
- "event": "failed",
- "conditions": [],
- "next": null,
- "uuid": "54c169ee-5129-433a-9901-97b4f2cfcd48"
- }
- ],
- "sid": "FF6c2c9ad0f0a45dd25473f72e733556bf"
- },
- {
- "name": "check_reply_content",
- "type": "Branch",
- "properties": {
- "offset": {
- "x": -660,
- "y": 1050
- },
- "input": "{{widgets.f_load_next.parsed.block.image}}"
- },
- "transitions": [
- {
- "event": "noMatch",
- "conditions": [],
- "next": "FF73177c1d07b34da7070a0e695ae8c26e",
- "uuid": "e6d51593-e739-4719-87a0-ef8f02e79a79"
- },
- {
- "event": "match",
- "conditions": [
- {
- "friendly_name": "has an image",
- "type": "is_not_blank",
- "arguments": [
- "{{widgets.f_load_next.parsed.block.image}}"
- ],
- "value": "Is Not Blank"
- }
- ],
- "next": "FFe87549d85fe468441e6d9d40bde711a0",
- "uuid": "8efb4d8a-396a-4e44-9a93-4f64baa561fd"
- }
- ],
- "sid": "FF4ab59e198c267b7b3104c2a4eb3f5d98"
- },
- {
- "name": "reply_text",
- "type": "MessagePrompt",
- "properties": {
- "offset": {
- "x": -430,
- "y": 1290
- },
- "body": "{{widgets.f_load_next.parsed.block.text}}",
- "from": "{{flow.channel.address}}",
- "timeout": 3600,
- "save_response_as": null,
- "media_url": null,
- "service": "{{trigger.message.InstanceSid}}",
- "channel": "{{trigger.message.ChannelSid}}",
- "attributes": null
- },
- "transitions": [
- {
- "event": "incomingMessage",
- "conditions": [],
- "next": "FF8624e33a96597460ed4c15f6a8deaa61",
- "uuid": "a56b1fb2-735b-44cb-a0e1-425bde4eb4ab"
- },
- {
- "event": "timeout",
- "conditions": [],
- "next": null,
- "uuid": "2f63ae87-0b0c-4cb4-a379-9316a03e7b1e"
- },
- {
- "event": "deliveryFailure",
- "conditions": [],
- "next": null,
- "uuid": "2df4ced5-b506-4b9d-ab4f-cb6f480c37c9"
- }
- ],
- "sid": "FF73177c1d07b34da7070a0e695ae8c26e"
- },
- {
- "name": "text_init",
- "type": "Webhook",
- "properties": {
- "offset": {
- "x": -930,
- "y": 170
- },
- "method": "POST",
- "url": "https://app.omsg.io",
- "body": "{\n \"organization\": \"5d152e71-cddb-431b-b97a-acc49332c547\",\n \"origin\": \"{{flow.channel.address}}\" ,\n \"phone\": \"{{contact.channel.address}}\",\n\"executionId\": \"{{flow.sid}}\"\n}",
- "timeout": null,
- "parameters": null,
- "save_response_as": null,
- "content_type": "application/json;charset=utf-8"
- },
- "transitions": [
- {
- "event": "success",
- "conditions": [],
- "next": null,
- "uuid": "c56ee5e3-3da7-4bcb-b1ef-e650a536286f"
- },
- {
- "event": "failed",
- "conditions": [],
- "next": null,
- "uuid": "217023c0-f873-4ef7-ba84-2cb838865b51"
- }
- ],
- "sid": "FFd7cbb252355a62accea2295484c8a272"
- },
- {
- "name": "f_webhook",
- "type": "Function",
- "properties": {
- "offset": {
- "x": 1220,
- "y": 1130
- },
- "url": "https://studio-helpers-4924-prod.twil.io/webhook",
- "timeout": null,
- "parameters": [
- {
- "key": "block",
- "value": "{{widgets.f_load_next.parsed.block | to_json}}"
- }
- ],
- "service_sid": "ZS3cc3d0fd33783728ce19a8a832b1d0b7",
- "function_sid": "ZNd6ba95c03d647885853d06f9640fdfae",
- "environment_sid": "ZE37b748efa9f8450169885eb99c673e1e"
- },
- "transitions": [
- {
- "event": "success",
- "conditions": [],
- "next": "FF517d06ea3d1db7e2505071488aa719df",
- "uuid": "1eb6bd6f-8c5d-48f5-9bab-adc5a2befb35"
- },
- {
- "event": "fail",
- "conditions": [],
- "next": "FF517d06ea3d1db7e2505071488aa719df",
- "uuid": "524f3b17-78c5-4149-b5b0-2f6a9affc8d3"
- }
- ],
- "sid": "FFf4ffb1f68de0eb3b556115367a6b14bb"
- },
- {
- "name": "v_set_replies",
- "type": "SetVariables",
- "properties": {
- "offset": {
- "x": -80,
- "y": 1840
- },
- "variables": [
- {
- "value": "{{ flow.variables.replies | append:\"?<<\" | append:flow.variables.current | append:\"<->\" | append:flow.variables.reply}}",
- "key": "replies",
- "index": "0"
- }
- ]
- },
- "transitions": [
- {
- "event": "next",
- "conditions": [],
- "next": "FF517d06ea3d1db7e2505071488aa719df",
- "uuid": "d7cd29f0-3321-4523-a8de-bb6fd1cd1d69"
- }
- ],
- "sid": "FF3831d850e46aec3d116f6fbb15f48f55"
- },
- {
- "name": "http_close",
- "type": "Webhook",
- "properties": {
- "offset": {
- "x": 1590,
- "y": 1130
- },
- "method": "POST",
- "url": "https://app.omsg.io/api/conversations/saveReplies",
- "body": "{\n \"executionId\": \"{{flow.sid}}\", \n \"replies\": \"{{flow.variables.replies}}\"\n}",
- "timeout": null,
- "parameters": null,
- "save_response_as": null,
- "content_type": "application/json;charset=utf-8"
- },
- "transitions": [
- {
- "event": "success",
- "conditions": [],
- "next": null,
- "uuid": "18ff0547-821b-4b5f-8372-d09236efb844"
- },
- {
- "event": "failed",
- "conditions": [],
- "next": null,
- "uuid": "fae89b31-d0fe-47b2-af37-e4593c2777f3"
- }
- ],
- "sid": "FF0dad89e568cc23690e859d5b36816d25"
- }
- ]
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement