Saltar al contenido principal

Ask on WhatsApp and wait

Pasowhatsapp-asknotifyefectos externos

Asks a question with up to three buttons and waits for the tap, then goes on with the answer. Outside 24 hours it sends the approved template you name.

De un vistazo​

PropiedadValor
Nombre del pasowhatsapp-ask
RecursoClusterStep (lumen.ai/v1alpha1)
Grupo de la paleta, categoríanotify, messages
Créditos1 crédito cada vez que tiene éxito
Efectos externossí Cambia algo fuera de Lumen, así que un reintento pregunta antes y una prueba muestra lo que haría en lugar de hacerlo.
La instalación debe aportarnada

Entradas​

PropiedadValor
Necesitanada
Producefields
Trabaja sobreitem un documento cada vez

Necesita y Produce son tipos de datos (file, text, fields, email). El editor ofrece un paso solo donde lo que necesita ya está en el camino. Consulta Documentos y datos.

Salidas​

Un nodo posterior se refiere a una salida como {nodeId.field} en un texto, o nodeId.field en una condición.

SalidaTipo
answerstring
answerTitlestring
answeredBystring
answeredAtdate
reasonstring
reasonQuotedstring

Ajustes​

Se definen bajo config: en el nodo del flujo. Los ajustes de texto pueden contener marcadores de posición como {nodeId.field}.

AjusteTipoValor por defectoDescripción
connectorRefstring-Send fromminLength 1
tostring-TomaxLength 200
toMemberstring-Their email. They must have joined this number with their phone (Profile, WhatsApp).maxLength 320
textobligatoriostring-QuestionminLength 1; maxLength 1024
buttonsobligatoriolist of object-AnswersminItems 1; maxItems 3
buttons[].idobligatoriostring-ID is what comes back in the run the tap starts (its buttonId).minLength 1; maxLength 256
buttons[].titleobligatoriostring-ButtonminLength 1; maxLength 20
templatestring-Template, Language and Params are the approved template sent when the person has not written in 24 hours. Its quick reply buttons must be in the same order as Buttons.maxLength 512
languagestring-Template languagemaxLength 15
paramslist of string-Template valuesmaxItems 20
timeoutHoursinteger72TimeoutHours is how long the run waits: 1 to 720, default 72. After it the step fails and the buttons answer nothing.minimum 1; maximum 720
reasonOnlist of string-Answer ids. After such a tap the person is asked why, and their next message is the reason.maxItems 3
reasonPromptstring-ReasonPrompt is what they are asked; empty is "Why? One line is enough."maxLength 200
reasonMinutesinteger30ReasonMinutes is how long the reply is waited for: 1 to 120, default 30. Never past the step's own wait.minimum 1; maximum 120

El JSON Schema completo de estos ajustes: whatsapp-ask.schema.json.

Ejemplo​

config
buttons:
- id: issue
title: הפק
- id: later
title: לא עכשיו
language: he
params:
- '{amount}'
template: receipt_approval
text: להפיק קבלה על {amount}?
timeoutHours: 48

Úsalo en un flujo​

Un nodo que ejecuta whatsapp-ask va bajo spec.nodes de un Flow. Dale cualquier id y enumera en next los ids de los nodos siguientes.

flow.yaml
apiVersion: lumen.ai/v1alpha1
kind: Connector
metadata:
name: my-whatsapp-cloud
namespace: tenant-acme
spec:
classRef: {name: whatsapp-cloud}
config: {}
---
apiVersion: lumen.ai/v1alpha1
kind: Flow
metadata:
name: whatsapp-ask-example
namespace: tenant-acme
spec:
displayName: "Ask on WhatsApp and wait"
triggers:
- id: start
ref: {name: whatsapp-message-received}
connectorRef: {name: my-whatsapp-cloud}
next: [whatsapp-ask]
nodes:
- id: whatsapp-ask
stepRef: {name: whatsapp-ask}
config:
buttons:
- id: issue
title: הפק
- id: later
title: לא עכשיו
language: he
params:
- '{amount}'
template: receipt_approval
text: להפיק קבלה על {amount}?
timeoutHours: 48