Opções de Notícias Climáticas Para o Cliente
Workflow manual que busca cinco artigos de notícias relacionados ao clima no GDELT, os envia como opções interativas para o cliente e retorna o texto completo do artigo depois que o cliente seleciona um.
manual messaging options news gdelt client interactive
O que está incluído
| Campo | Valor |
|---|---|
| Nome | Opções de Notícias Climáticas Para o Cliente |
| Tipo | Workflow |
| Trigger | manual |
| Etapas | 3 |
| Entradas | 1 |
JSON Completo
Clique para expandir
{
"description": "Manual workflow that fetches five climate-related GDELT news articles, sends them as interactive client options, and returns the full article text after the client selects one.",
"tags": [
"manual",
"messaging",
"options",
"news",
"gdelt",
"client",
"interactive"
],
"document": {
"name": "Climate News Options To Client",
"enabled": true,
"log_level": "info",
"trigger": {
"type": "manual"
},
"workflowInput": [
{
"name": "client",
"description": "Client to receive the news options",
"schema": {
"type": "ref",
"required": true,
"enableEnums": false,
"enum": [],
"ref": "clients"
}
}
],
"steps": [
{
"condition": {
"expr": "true",
"onFailure": "throw",
"fallback": "",
"resultType": "any",
"strict": false,
"useSimpleCel": false
},
"action": {
"actionType": "actions/network/http/request/send",
"actions/network/http/request/send": {
"method": "GET",
"url": {
"expr": "\"https://gdelt.adriel.eu/doc?query=climate&mode=ArtList&maxrecords=5&format=json\"",
"onFailure": "throw",
"fallback": "",
"resultType": "any",
"strict": false,
"useSimpleCel": false
},
"headers": [],
"returnBuffer": false,
"cache": false
}
}
},
{
"condition": {
"expr": "present(client) && step_ok(0) && size(step_data(0, \"articles\", [])) >= 5",
"onFailure": "throw",
"fallback": "",
"resultType": "any",
"strict": false,
"useSimpleCel": false
},
"action": {
"actionType": "actions/messaging/contact/send",
"actions/messaging/contact/send": {
"use_manual_id": true,
"contactId_manual": {
"expr": "client",
"onFailure": "throw",
"fallback": "",
"resultType": "any",
"strict": false,
"useSimpleCel": false
},
"messages": [
{
"type": "options",
"payload": {
"title": {
"expr": "\"Top 5 Climate News\"",
"onFailure": "throw",
"fallback": "",
"resultType": "any",
"strict": false,
"useSimpleCel": false
},
"description": {
"expr": "\"Choose one option to receive the complete story text.\"",
"onFailure": "throw",
"fallback": "",
"resultType": "any",
"strict": false,
"useSimpleCel": false
},
"options": [
{
"label": {
"expr": "substring(coalesce(step(0).data.articles[0].title, \"News 1\"), 0, 24)",
"onFailure": "throw",
"fallback": "",
"resultType": "any",
"strict": false,
"useSimpleCel": false
},
"value": {
"expr": "coalesce(step(0).data.articles[0].url, \"\")",
"onFailure": "throw",
"fallback": "",
"resultType": "any",
"strict": false,
"useSimpleCel": false
},
"actions": [
{
"condition": {
"expr": "present(coalesce(trigger.value, contactMessage.body.value))",
"onFailure": "throw",
"fallback": "",
"resultType": "any",
"strict": false,
"useSimpleCel": false
},
"action": {
"actionType": "actions/network/http/request/send",
"actions/network/http/request/send": {
"method": "GET",
"url": {
"expr": "url_params(\"https://gdelt.adriel.eu/doc/content\", {\"url\": coalesce(trigger.value, contactMessage.body.value)})",
"onFailure": "throw",
"fallback": "",
"resultType": "any",
"strict": false,
"useSimpleCel": false
},
"headers": [],
"returnBuffer": false,
"cache": false
}
}
},
{
"condition": {
"expr": "step_ok(0) && present(step_data(0, \"text\"))",
"onFailure": "throw",
"fallback": "",
"resultType": "any",
"strict": false,
"useSimpleCel": false
},
"action": {
"actionType": "actions/messaging/conversation/response/compose",
"actions/messaging/conversation/response/compose": {
"messages": [
{
"type": "text",
"payload": {
"text": {
"expr": "(present(step_data(0, \"title\")) ? step_data(0, \"title\") + \"\\n\\n\" : \"\") + step_data(0, \"text\", \"\")",
"onFailure": "throw",
"fallback": "",
"resultType": "any",
"strict": false,
"useSimpleCel": false
}
}
}
]
}
}
},
{
"condition": {
"expr": "!step_ok(0) || blank(step_data(0, \"text\"))",
"onFailure": "throw",
"fallback": "",
"resultType": "any",
"strict": false,
"useSimpleCel": false
},
"action": {
"actionType": "actions/messaging/conversation/response/compose",
"actions/messaging/conversation/response/compose": {
"messages": [
{
"type": "text",
"payload": {
"text": {
"expr": "\"I couldn't fetch the full story right now. Try another option in a moment.\"",
"onFailure": "throw",
"fallback": "",
"resultType": "any",
"strict": false,
"useSimpleCel": false
}
}
}
]
}
}
}
],
"forwardMessageToAgent": false
},
{
"label": {
"expr": "substring(coalesce(step(0).data.articles[1].title, \"News 2\"), 0, 24)",
"onFailure": "throw",
"fallback": "",
"resultType": "any",
"strict": false,
"useSimpleCel": false
},
"value": {
"expr": "coalesce(step(0).data.articles[1].url, \"\")",
"onFailure": "throw",
"fallback": "",
"resultType": "any",
"strict": false,
"useSimpleCel": false
},
"actions": [
{
"condition": {
"expr": "present(coalesce(trigger.value, contactMessage.body.value))",
"onFailure": "throw",
"fallback": "",
"resultType": "any",
"strict": false,
"useSimpleCel": false
},
"action": {
"actionType": "actions/network/http/request/send",
"actions/network/http/request/send": {
"method": "GET",
"url": {
"expr": "url_params(\"https://gdelt.adriel.eu/doc/content\", {\"url\": coalesce(trigger.value, contactMessage.body.value)})",
"onFailure": "throw",
"fallback": "",
"resultType": "any",
"strict": false,
"useSimpleCel": false
},
"headers": [],
"returnBuffer": false,
"cache": false
}
}
},
{
"condition": {
"expr": "step_ok(0) && present(step_data(0, \"text\"))",
"onFailure": "throw",
"fallback": "",
"resultType": "any",
"strict": false,
"useSimpleCel": false
},
"action": {
"actionType": "actions/messaging/conversation/response/compose",
"actions/messaging/conversation/response/compose": {
"messages": [
{
"type": "text",
"payload": {
"text": {
"expr": "(present(step_data(0, \"title\")) ? step_data(0, \"title\") + \"\\n\\n\" : \"\") + step_data(0, \"text\", \"\")",
"onFailure": "throw",
"fallback": "",
"resultType": "any",
"strict": false,
"useSimpleCel": false
}
}
}
]
}
}
},
{
"condition": {
"expr": "!step_ok(0) || blank(step_data(0, \"text\"))",
"onFailure": "throw",
"fallback": "",
"resultType": "any",
"strict": false,
"useSimpleCel": false
},
"action": {
"actionType": "actions/messaging/conversation/response/compose",
"actions/messaging/conversation/response/compose": {
"messages": [
{
"type": "text",
"payload": {
"text": {
"expr": "\"I couldn't fetch the full story right now. Try another option in a moment.\"",
"onFailure": "throw",
"fallback": "",
"resultType": "any",
"strict": false,
"useSimpleCel": false
}
}
}
]
}
}
}
],
"forwardMessageToAgent": false
},
{
"label": {
"expr": "substring(coalesce(step(0).data.articles[2].title, \"News 3\"), 0, 24)",
"onFailure": "throw",
"fallback": "",
"resultType": "any",
"strict": false,
"useSimpleCel": false
},
"value": {
"expr": "coalesce(step(0).data.articles[2].url, \"\")",
"onFailure": "throw",
"fallback": "",
"resultType": "any",
"strict": false,
"useSimpleCel": false
},
"actions": [
{
"condition": {
"expr": "present(coalesce(trigger.value, contactMessage.body.value))",
"onFailure": "throw",
"fallback": "",
"resultType": "any",
"strict": false,
"useSimpleCel": false
},
"action": {
"actionType": "actions/network/http/request/send",
"actions/network/http/request/send": {
"method": "GET",
"url": {
"expr": "url_params(\"https://gdelt.adriel.eu/doc/content\", {\"url\": coalesce(trigger.value, contactMessage.body.value)})",
"onFailure": "throw",
"fallback": "",
"resultType": "any",
"strict": false,
"useSimpleCel": false
},
"headers": [],
"returnBuffer": false,
"cache": false
}
}
},
{
"condition": {
"expr": "step_ok(0) && present(step_data(0, \"text\"))",
"onFailure": "throw",
"fallback": "",
"resultType": "any",
"strict": false,
"useSimpleCel": false
},
"action": {
"actionType": "actions/messaging/conversation/response/compose",
"actions/messaging/conversation/response/compose": {
"messages": [
{
"type": "text",
"payload": {
"text": {
"expr": "(present(step_data(0, \"title\")) ? step_data(0, \"title\") + \"\\n\\n\" : \"\") + step_data(0, \"text\", \"\")",
"onFailure": "throw",
"fallback": "",
"resultType": "any",
"strict": false,
"useSimpleCel": false
}
}
}
]
}
}
},
{
"condition": {
"expr": "!step_ok(0) || blank(step_data(0, \"text\"))",
"onFailure": "throw",
"fallback": "",
"resultType": "any",
"strict": false,
"useSimpleCel": false
},
"action": {
"actionType": "actions/messaging/conversation/response/compose",
"actions/messaging/conversation/response/compose": {
"messages": [
{
"type": "text",
"payload": {
"text": {
"expr": "\"I couldn't fetch the full story right now. Try another option in a moment.\"",
"onFailure": "throw",
"fallback": "",
"resultType": "any",
"strict": false,
"useSimpleCel": false
}
}
}
]
}
}
}
],
"forwardMessageToAgent": false
},
{
"label": {
"expr": "substring(coalesce(step(0).data.articles[3].title, \"News 4\"), 0, 24)",
"onFailure": "throw",
"fallback": "",
"resultType": "any",
"strict": false,
"useSimpleCel": false
},
"value": {
"expr": "coalesce(step(0).data.articles[3].url, \"\")",
"onFailure": "throw",
"fallback": "",
"resultType": "any",
"strict": false,
"useSimpleCel": false
},
"actions": [
{
"condition": {
"expr": "present(coalesce(trigger.value, contactMessage.body.value))",
"onFailure": "throw",
"fallback": "",
"resultType": "any",
"strict": false,
"useSimpleCel": false
},
"action": {
"actionType": "actions/network/http/request/send",
"actions/network/http/request/send": {
"method": "GET",
"url": {
"expr": "url_params(\"https://gdelt.adriel.eu/doc/content\", {\"url\": coalesce(trigger.value, contactMessage.body.value)})",
"onFailure": "throw",
"fallback": "",
"resultType": "any",
"strict": false,
"useSimpleCel": false
},
"headers": [],
"returnBuffer": false,
"cache": false
}
}
},
{
"condition": {
"expr": "step_ok(0) && present(step_data(0, \"text\"))",
"onFailure": "throw",
"fallback": "",
"resultType": "any",
"strict": false,
"useSimpleCel": false
},
"action": {
"actionType": "actions/messaging/conversation/response/compose",
"actions/messaging/conversation/response/compose": {
"messages": [
{
"type": "text",
"payload": {
"text": {
"expr": "(present(step_data(0, \"title\")) ? step_data(0, \"title\") + \"\\n\\n\" : \"\") + step_data(0, \"text\", \"\")",
"onFailure": "throw",
"fallback": "",
"resultType": "any",
"strict": false,
"useSimpleCel": false
}
}
}
]
}
}
},
{
"condition": {
"expr": "!step_ok(0) || blank(step_data(0, \"text\"))",
"onFailure": "throw",
"fallback": "",
"resultType": "any",
"strict": false,
"useSimpleCel": false
},
"action": {
"actionType": "actions/messaging/conversation/response/compose",
"actions/messaging/conversation/response/compose": {
"messages": [
{
"type": "text",
"payload": {
"text": {
"expr": "\"I couldn't fetch the full story right now. Try another option in a moment.\"",
"onFailure": "throw",
"fallback": "",
"resultType": "any",
"strict": false,
"useSimpleCel": false
}
}
}
]
}
}
}
],
"forwardMessageToAgent": false
},
{
"label": {
"expr": "substring(coalesce(step(0).data.articles[4].title, \"News 5\"), 0, 24)",
"onFailure": "throw",
"fallback": "",
"resultType": "any",
"strict": false,
"useSimpleCel": false
},
"value": {
"expr": "coalesce(step(0).data.articles[4].url, \"\")",
"onFailure": "throw",
"fallback": "",
"resultType": "any",
"strict": false,
"useSimpleCel": false
},
"actions": [
{
"condition": {
"expr": "present(coalesce(trigger.value, contactMessage.body.value))",
"onFailure": "throw",
"fallback": "",
"resultType": "any",
"strict": false,
"useSimpleCel": false
},
"action": {
"actionType": "actions/network/http/request/send",
"actions/network/http/request/send": {
"method": "GET",
"url": {
"expr": "url_params(\"https://gdelt.adriel.eu/doc/content\", {\"url\": coalesce(trigger.value, contactMessage.body.value)})",
"onFailure": "throw",
"fallback": "",
"resultType": "any",
"strict": false,
"useSimpleCel": false
},
"headers": [],
"returnBuffer": false,
"cache": false
}
}
},
{
"condition": {
"expr": "step_ok(0) && present(step_data(0, \"text\"))",
"onFailure": "throw",
"fallback": "",
"resultType": "any",
"strict": false,
"useSimpleCel": false
},
"action": {
"actionType": "actions/messaging/conversation/response/compose",
"actions/messaging/conversation/response/compose": {
"messages": [
{
"type": "text",
"payload": {
"text": {
"expr": "(present(step_data(0, \"title\")) ? step_data(0, \"title\") + \"\\n\\n\" : \"\") + step_data(0, \"text\", \"\")",
"onFailure": "throw",
"fallback": "",
"resultType": "any",
"strict": false,
"useSimpleCel": false
}
}
}
]
}
}
},
{
"condition": {
"expr": "!step_ok(0) || blank(step_data(0, \"text\"))",
"onFailure": "throw",
"fallback": "",
"resultType": "any",
"strict": false,
"useSimpleCel": false
},
"action": {
"actionType": "actions/messaging/conversation/response/compose",
"actions/messaging/conversation/response/compose": {
"messages": [
{
"type": "text",
"payload": {
"text": {
"expr": "\"I couldn't fetch the full story right now. Try another option in a moment.\"",
"onFailure": "throw",
"fallback": "",
"resultType": "any",
"strict": false,
"useSimpleCel": false
}
}
}
]
}
}
}
],
"forwardMessageToAgent": false
}
]
}
}
]
}
}
},
{
"condition": {
"expr": "present(client) && !(step_ok(0) && size(step_data(0, \"articles\", [])) >= 5)",
"onFailure": "throw",
"fallback": "",
"resultType": "any",
"strict": false,
"useSimpleCel": false
},
"action": {
"actionType": "actions/messaging/contact/send",
"actions/messaging/contact/send": {
"use_manual_id": true,
"contactId_manual": {
"expr": "client",
"onFailure": "throw",
"fallback": "",
"resultType": "any",
"strict": false,
"useSimpleCel": false
},
"messages": [
{
"type": "text",
"payload": {
"text": {
"expr": "\"I couldn't load 5 climate news items right now. Please run this workflow again in a moment.\"",
"onFailure": "throw",
"fallback": "",
"resultType": "any",
"strict": false,
"useSimpleCel": false
}
}
}
]
}
}
}
],
"returnExpression": {
"expr": "{\"requestedClient\": client, \"status\": step(0).status, \"articles\": get(step(0), \"data.articles\", [])}",
"onFailure": "throw",
"fallback": "",
"resultType": "any",
"strict": false,
"useSimpleCel": false
},
"customAttributes": {}
}
}
Como Importar
- Baixe o arquivo ZIP usando o botão acima
- Navegue até Configurações da Empresa → Transferência de Dados no seu painel AutoTalk
- Clique em Importar e selecione o arquivo ZIP baixado
- Revise o resumo da importação e confirme
- Todos os IDs de documentos são remapeados automaticamente — nenhuma edição manual de IDs é necessária