{ "name": "Integration WhatsApp Business Cloud", "flow": [ { "id": 3, "module": "whatsapp-business-cloud:watchEvents", "version": 1, "parameters": { "__IMTHOOK__": 1692798 }, "mapper": {}, "metadata": { "designer": { "x": -258, "y": 4 }, "restore": { "parameters": { "__IMTHOOK__": { "data": { "editable": "false" }, "label": "My WhatsApp Business Cloud Events webhook" } } }, "parameters": [ { "name": "__IMTHOOK__", "type": "hook:whatsapp-business-cloud2", "label": "Webhook", "required": true } ], "interface": [ { "name": "id", "type": "text", "label": "WhatsApp Business Account ID" }, { "name": "time", "type": "date", "label": "Time" }, { "name": "field", "type": "text", "label": "Field" }, { "name": "messaging_product", "type": "text", "label": "Messaging Product" }, { "name": "metadata", "spec": [ { "name": "display_phone_number", "type": "text", "label": "Display Phone Number" }, { "name": "phone_number_id", "type": "text", "label": "Phone Number ID" } ], "type": "collection", "label": "Metadata" }, { "name": "contacts", "spec": { "spec": [ { "name": "profile", "spec": [ { "name": "name", "type": "text", "label": "Name" } ], "type": "collection", "label": "Profile" }, { "name": "wa_id", "type": "text", "label": "WhatsApp ID" } ], "type": "collection" }, "type": "array", "label": "Contacts" }, { "name": "messages", "spec": { "spec": [ { "name": "from", "type": "text", "label": "Sender" }, { "name": "id", "type": "text", "label": "Message ID" }, { "name": "timestamp", "type": "date", "label": "Timestamp" }, { "name": "text", "spec": [ { "name": "body", "type": "text", "label": "Body" } ], "type": "collection", "label": "Text" }, { "name": "type", "type": "text", "label": "Type" }, { "name": "image", "spec": [ { "name": "caption", "type": "text", "label": "Caption" }, { "name": "mime_type", "type": "text", "label": "MIME Type" }, { "name": "sha256", "type": "text", "label": "SHA256" }, { "name": "id", "type": "text", "label": "Media ID" } ], "type": "collection", "label": "Image" }, { "name": "audio", "spec": [ { "name": "mime_type", "type": "text", "label": "MIME Type" }, { "name": "sha256", "type": "text", "label": "SHA256" }, { "name": "id", "type": "text", "label": "Media ID" }, { "name": "voice", "type": "boolean", "label": "Voice" } ], "type": "collection", "label": "Audio" }, { "name": "video", "spec": [ { "name": "caption", "type": "text", "label": "Caption" }, { "name": "mime_type", "type": "text", "label": "MIME Type" }, { "name": "sha256", "type": "text", "label": "SHA256" }, { "name": "id", "type": "text", "label": "Media ID" } ], "type": "collection", "label": "Video" }, { "name": "document", "spec": [ { "name": "caption", "type": "text", "label": "Caption" }, { "name": "filename", "type": "text", "label": "File Name" }, { "name": "mime_type", "type": "text", "label": "MIME Type" }, { "name": "sha256", "type": "text", "label": "SHA256" }, { "name": "id", "type": "text", "label": "Media ID" } ], "type": "collection", "label": "Document" }, { "name": "contacts", "spec": { "spec": [ { "name": "name", "spec": [ { "name": "formatted_name", "type": "text", "label": "Formatted Name" }, { "name": "first_name", "type": "text", "label": "First Name" }, { "name": "last_name", "type": "text", "label": "Last Name" }, { "name": "middle_name", "type": "text", "label": "Middle Name" }, { "name": "suffix", "type": "text", "label": "Name Suffix" }, { "name": "prefix", "type": "text", "label": "Name Prefix" } ], "type": "collection", "label": "Name" }, { "name": "phones", "spec": [ { "name": "phone", "type": "text", "label": "Phone" }, { "name": "type", "type": "text", "label": "Type" } ], "type": "array", "label": "Phones" }, { "name": "emails", "spec": [ { "name": "email", "type": "email", "label": "Email" }, { "name": "type", "type": "text", "label": "Type" } ], "type": "array", "label": "Emails" }, { "name": "org", "spec": [ { "name": "company", "type": "text", "label": "Company" }, { "name": "department", "type": "text", "label": "Department" }, { "name": "title", "type": "text", "label": "Title" } ], "type": "collection", "label": "Organization" }, { "name": "urls", "spec": [ { "name": "type", "type": "text", "label": "Type" }, { "name": "url", "type": "url", "label": "URL" } ], "type": "array", "label": "URLs" }, { "name": "addresses", "spec": [ { "name": "type", "type": "text", "label": "Type" }, { "name": "street", "type": "text", "label": "Street" }, { "name": "city", "type": "text", "label": "City" }, { "name": "zip", "type": "text", "label": "ZIP" }, { "name": "country", "type": "text", "label": "Country" }, { "name": "country_code", "type": "text", "label": "Country Code" } ], "type": "array", "label": "Addresses" }, { "name": "birthday", "type": "text", "label": "Birthday" } ], "type": "collection" }, "type": "array", "label": "Contacts" }, { "name": "sticker", "spec": [ { "name": "mime_type", "type": "text", "label": "MIME Type" }, { "name": "sha256", "type": "text", "label": "SHA256" }, { "name": "id", "type": "text", "label": "Media ID" } ], "type": "collection", "label": "Sticker" }, { "name": "location", "spec": [ { "name": "latitude", "type": "number", "label": "Latitude" }, { "name": "longitude", "type": "number", "label": "Longitude" }, { "name": "name", "type": "text", "label": "Name" }, { "name": "address", "type": "text", "label": "Address" } ], "type": "collection", "label": "Location" }, { "name": "context", "spec": [ { "name": "from", "type": "text", "label": "From" }, { "name": "id", "type": "text", "label": "Context ID" } ], "type": "collection", "label": "Context" }, { "name": "button", "spec": [ { "name": "payload", "type": "text", "label": "Payload" }, { "name": "text", "type": "text", "label": "Text" } ], "type": "collection", "label": "Button" }, { "name": "interactive", "spec": [ { "name": "type", "type": "text", "label": "Type" }, { "name": "list_reply", "spec": [ { "name": "id", "type": "number", "label": "ID" }, { "name": "title", "type": "text", "label": "Title" }, { "name": "description", "type": "text", "label": "Description" } ], "type": "collection", "label": "List Reply" }, { "name": "button_reply", "spec": [ { "name": "id", "type": "number", "label": "ID" }, { "name": "title", "type": "text", "label": "Title" } ], "type": "collection", "label": "Button Reply" } ], "type": "collection", "label": "Interactive" } ], "type": "collection" }, "type": "array", "label": "Messages" } ] } }, { "id": 6, "module": "builtin:BasicRouter", "version": 1, "mapper": null, "metadata": { "designer": { "x": -35, "y": 6 } }, "routes": [ { "flow": [ { "id": 7, "module": "http:ActionSendData", "version": 3, "parameters": { "handleErrors": true, "useNewZLibDeCompress": true }, "filter": { "name": "Text", "conditions": [ [ { "a": "{{3.messages[].audio}}", "b": "", "o": "text:equal" } ] ] }, "mapper": { "ca": "", "qs": [], "url": "https://api-d7b62b.stack.tryrelevance.com/latest/agents/trigger", "data": "{\"message\":{\"role\":\"user\",\"content\":\"{{3.messages[].text.body}}\"},\"agent_id\":\"894a2735-27fd-4e4a-aa20-a54037d3f176\",\"conversation_id\":\"894a2735-27fd-4e4a-aa20-a54037d3f176\"}", "gzip": true, "method": "post", "headers": [ { "name": "Content-Type", "value": "application/json" }, { "name": "Authorization", "value": "b7405bf3cbe3-414d-9074-fdd2876196f0:sk-M2IzNGQ3N2YtZmRjZi00MmIxLTgwZGQtZTk0ZDA2Zjk1YTI4" } ], "timeout": "", "useMtls": false, "authPass": "", "authUser": "", "bodyType": "raw", "contentType": "application/json", "serializeUrl": false, "shareCookies": false, "parseResponse": true, "followRedirect": true, "useQuerystring": false, "followAllRedirects": false, "rejectUnauthorized": true }, "metadata": { "designer": { "x": 292, "y": 172 }, "restore": { "expect": { "qs": { "mode": "chose" }, "method": { "mode": "chose", "label": "POST" }, "headers": { "mode": "chose", "items": [ null, null ] }, "bodyType": { "label": "Raw" }, "contentType": { "label": "JSON (application/json)" } } }, "parameters": [ { "name": "handleErrors", "type": "boolean", "label": "Evaluate all states as errors (except for 2xx and 3xx )", "required": true }, { "name": "useNewZLibDeCompress", "type": "hidden" } ], "expect": [ { "name": "url", "type": "url", "label": "URL", "required": true }, { "name": "serializeUrl", "type": "boolean", "label": "Serialize URL", "required": true }, { "name": "method", "type": "select", "label": "Method", "required": true, "validate": { "enum": [ "get", "head", "post", "put", "patch", "delete", "options" ] } }, { "name": "headers", "spec": [ { "name": "name", "type": "text", "label": "Name", "required": true }, { "name": "value", "type": "text", "label": "Value" } ], "type": "array", "label": "Headers" }, { "name": "qs", "spec": [ { "name": "name", "type": "text", "label": "Name", "required": true }, { "name": "value", "type": "text", "label": "Value" } ], "type": "array", "label": "Query String" }, { "name": "bodyType", "type": "select", "label": "Body type", "validate": { "enum": [ "raw", "x_www_form_urlencoded", "multipart_form_data" ] } }, { "name": "parseResponse", "type": "boolean", "label": "Parse response", "required": true }, { "name": "authUser", "type": "text", "label": "User name" }, { "name": "authPass", "type": "password", "label": "Password" }, { "name": "timeout", "type": "uinteger", "label": "Timeout", "validate": { "max": 300, "min": 1 } }, { "name": "shareCookies", "type": "boolean", "label": "Share cookies with other HTTP modules", "required": true }, { "name": "ca", "type": "cert", "label": "Self-signed certificate" }, { "name": "rejectUnauthorized", "type": "boolean", "label": "Reject connections that are using unverified (self-signed) certificates", "required": true }, { "name": "followRedirect", "type": "boolean", "label": "Follow redirect", "required": true }, { "name": "useQuerystring", "type": "boolean", "label": "Disable serialization of multiple same query string keys as arrays", "required": true }, { "name": "gzip", "type": "boolean", "label": "Request compressed content", "required": true }, { "name": "useMtls", "type": "boolean", "label": "Use Mutual TLS", "required": true }, { "name": "contentType", "type": "select", "label": "Content type", "validate": { "enum": [ "text/plain", "application/json", "application/xml", "text/xml", "text/html", "custom" ] } }, { "name": "data", "type": "buffer", "label": "Request content" }, { "name": "followAllRedirects", "type": "boolean", "label": "Follow all redirect", "required": true } ] } } ] }, { "flow": [ { "id": 4, "module": "whatsapp-business-cloud:getMedia", "version": 1, "parameters": { "__IMTCONN__": 2882568 }, "filter": { "name": "Audio", "conditions": [ [ { "a": "{{3.messages[].audio}}", "o": "exist" } ] ] }, "mapper": { "mediaId": "{{3.messages[].audio.id}}" }, "metadata": { "designer": { "x": 281, "y": -207 }, "restore": { "parameters": { "__IMTCONN__": { "data": { "scoped": "true", "connection": "whatsapp-business-cloud2" }, "label": "API 2 (Ben)" } } }, "parameters": [ { "name": "__IMTCONN__", "type": "account:whatsapp-business-cloud2", "label": "Connection", "required": true } ], "expect": [ { "name": "mediaId", "type": "text", "label": "Media ID", "required": true } ] } }, { "id": 5, "module": "openai-gpt-3:CreateTranscription", "version": 1, "parameters": { "__IMTCONN__": 2882820 }, "mapper": { "model": "whisper-1", "fileData": "{{4.mediaData}}", "fileName": "{{4.mediaName}}", "temperature": "1", "response_format": "json" }, "metadata": { "designer": { "x": 606, "y": -199 }, "restore": { "expect": { "model": { "mode": "chose", "label": "Whisper-1" }, "response_format": { "mode": "chose", "label": "JSON" } }, "parameters": { "__IMTCONN__": { "data": { "scoped": "true", "connection": "openai-gpt-3" }, "label": "My OpenAI connection" } } }, "parameters": [ { "name": "__IMTCONN__", "type": "account:openai-gpt-3", "label": "Connection", "required": true } ], "expect": [ { "name": "fileName", "type": "filename", "label": "File Name", "required": true }, { "name": "fileData", "type": "buffer", "label": "File Data", "required": true }, { "name": "model", "type": "select", "label": "Model", "required": true }, { "name": "prompt", "type": "text", "label": "Prompt" }, { "name": "response_format", "type": "select", "label": "Response Format", "validate": { "enum": [ "json", "text", "srt", "verbose_json", "vtt" ] } }, { "name": "temperature", "type": "number", "label": "Temperature", "validate": { "max": 1, "min": 0 } }, { "name": "language", "type": "text", "label": "Language" } ], "interface": [ { "name": "text", "type": "text", "label": "Text" } ] } }, { "id": 8, "module": "http:ActionSendData", "version": 3, "parameters": { "handleErrors": true, "useNewZLibDeCompress": true }, "mapper": { "ca": "", "qs": [], "url": "https://api-d7b62b.stack.tryrelevance.com/latest/agents/trigger", "data": "{\"message\":{\"role\":\"user\",\"content\":\"{{5.text}}\"},\"agent_id\":\"894a2735-27fd-4e4a-aa20-a54037d3f176\",\"conversation_id\":\"894a2735-27fd-4e4a-aa20-a54037d3f176\"}", "gzip": true, "method": "post", "headers": [ { "name": "Content-Type", "value": "application/json" }, { "name": "Authorization", "value": "b7405bf3cbe3-414d-9074-fdd2876196f0:sk-M2IzNGQ3N2YtZmRjZi00MmIxLTgwZGQtZTk0ZDA2Zjk1YTI4" } ], "timeout": "", "useMtls": false, "authPass": "", "authUser": "", "bodyType": "raw", "contentType": "application/json", "serializeUrl": false, "shareCookies": false, "parseResponse": true, "followRedirect": true, "useQuerystring": false, "followAllRedirects": false, "rejectUnauthorized": true }, "metadata": { "designer": { "x": 916, "y": -214 }, "restore": { "expect": { "qs": { "mode": "chose" }, "method": { "mode": "chose", "label": "POST" }, "headers": { "mode": "chose", "items": [ null, null ] }, "bodyType": { "label": "Raw" }, "contentType": { "label": "JSON (application/json)" } } }, "parameters": [ { "name": "handleErrors", "type": "boolean", "label": "Evaluate all states as errors (except for 2xx and 3xx )", "required": true }, { "name": "useNewZLibDeCompress", "type": "hidden" } ], "expect": [ { "name": "url", "type": "url", "label": "URL", "required": true }, { "name": "serializeUrl", "type": "boolean", "label": "Serialize URL", "required": true }, { "name": "method", "type": "select", "label": "Method", "required": true, "validate": { "enum": [ "get", "head", "post", "put", "patch", "delete", "options" ] } }, { "name": "headers", "spec": [ { "name": "name", "type": "text", "label": "Name", "required": true }, { "name": "value", "type": "text", "label": "Value" } ], "type": "array", "label": "Headers" }, { "name": "qs", "spec": [ { "name": "name", "type": "text", "label": "Name", "required": true }, { "name": "value", "type": "text", "label": "Value" } ], "type": "array", "label": "Query String" }, { "name": "bodyType", "type": "select", "label": "Body type", "validate": { "enum": [ "raw", "x_www_form_urlencoded", "multipart_form_data" ] } }, { "name": "parseResponse", "type": "boolean", "label": "Parse response", "required": true }, { "name": "authUser", "type": "text", "label": "User name" }, { "name": "authPass", "type": "password", "label": "Password" }, { "name": "timeout", "type": "uinteger", "label": "Timeout", "validate": { "max": 300, "min": 1 } }, { "name": "shareCookies", "type": "boolean", "label": "Share cookies with other HTTP modules", "required": true }, { "name": "ca", "type": "cert", "label": "Self-signed certificate" }, { "name": "rejectUnauthorized", "type": "boolean", "label": "Reject connections that are using unverified (self-signed) certificates", "required": true }, { "name": "followRedirect", "type": "boolean", "label": "Follow redirect", "required": true }, { "name": "useQuerystring", "type": "boolean", "label": "Disable serialization of multiple same query string keys as arrays", "required": true }, { "name": "gzip", "type": "boolean", "label": "Request compressed content", "required": true }, { "name": "useMtls", "type": "boolean", "label": "Use Mutual TLS", "required": true }, { "name": "contentType", "type": "select", "label": "Content type", "validate": { "enum": [ "text/plain", "application/json", "application/xml", "text/xml", "text/html", "custom" ] } }, { "name": "data", "type": "buffer", "label": "Request content" }, { "name": "followAllRedirects", "type": "boolean", "label": "Follow all redirect", "required": true } ] } } ] } ] } ], "metadata": { "instant": true, "version": 1, "scenario": { "roundtrips": 1, "maxErrors": 3, "autoCommit": true, "autoCommitTriggerLast": true, "sequential": false, "slots": null, "confidential": false, "dataloss": false, "dlq": false, "freshVariables": false }, "designer": { "orphans": [] }, "zone": "us1.make.com" } }