Saltar al contenido principal

Opciones de Noticias Climáticas Para el Cliente

Workflow manual que obtiene cinco artículos de noticias relacionadas con el clima en GDELT, los envía como opciones interactivas al cliente y devuelve el texto completo del artículo después de que el cliente seleccione uno.

manual messaging options news gdelt client interactive

Descargar ZIP

Qué está incluido

CampoValor
NombreOpciones de Noticias Climáticas Para el Cliente
TipoWorkflow
Triggermanual
Pasos3
Entradas1

JSON Completo

Clic 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

  1. Descargue el archivo ZIP usando el botón de arriba
  2. Navegue a Configuración de la Empresa → Transferencia de Datos en su panel de AutoTalk
  3. Haga clic en Importar y seleccione el archivo ZIP descargado
  4. Revise el resumen de importación y confirme
  5. Todos los IDs de documentos se remapean automáticamente — no se necesita edición manual de IDs