Zum Hauptinhalt springen

Ask on WhatsApp and wait

Schrittwhatsapp-asknotifyexterne Wirkung

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.

Auf einen Blick​

EigenschaftWert
Schrittnamewhatsapp-ask
RessourceClusterStep (lumen.ai/v1alpha1)
Palettengruppe, Kategorienotify, messages
Credits1 Credit bei jedem Erfolg
Externe Wirkungja Er ändert etwas außerhalb von Lumen, deshalb fragt ein Wiederholungsversuch vorher nach, und ein Test zeigt, was er tun würde, statt es zu tun.
Die Installation muss bereitstellennichts

Eingaben​

EigenschaftWert
Brauchtnichts
Liefertfields
Arbeitet aufitem einem Dokument nach dem anderen

Braucht und Liefert sind Datentypen (file, text, fields, email). Der Editor bietet einen Schritt nur dort an, wo das, was er braucht, schon auf dem Pfad liegt. Siehe Dokumente und Daten.

Ausgaben​

Ein späterer Knoten verweist auf eine Ausgabe als {nodeId.field} in einem Text oder als nodeId.field in einer Bedingung.

AusgabeTyp
answerstring
answerTitlestring
answeredBystring
answeredAtdate
reasonstring
reasonQuotedstring

Einstellungen​

Wird unter config: im Knoten des Flows gesetzt. Texteinstellungen dürfen Platzhalter wie {nodeId.field} enthalten.

EinstellungTypStandardwertBeschreibung
connectorRefstring-Send fromminLength 1
tostring-TomaxLength 200
toMemberstring-Their email. They must have joined this number with their phone (Profile, WhatsApp).maxLength 320
texterforderlichstring-QuestionminLength 1; maxLength 1024
buttonserforderlichlist of object-AnswersminItems 1; maxItems 3
buttons[].iderforderlichstring-ID is what comes back in the run the tap starts (its buttonId).minLength 1; maxLength 256
buttons[].titleerforderlichstring-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

Das vollständige JSON Schema dieser Einstellungen: whatsapp-ask.schema.json.

Beispiel​

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

Im Flow verwenden​

Ein Knoten, der whatsapp-ask ausführt, steht unter spec.nodes eines Flow. Geben Sie ihm eine beliebige id und nennen Sie in next die ids der nächsten Knoten.

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