|
Node |
Check Recent Conversations |
|---|---|
|
Description |
This node |
Execution & Payload Details:
-
Reads from:
-
msg.payload.customer_id(string/number) -
msg.payload.channel_type(string) -
msg.payload.direction(string)
-
-
External call:
-
getCustomerRecentConversation(customer_id, channel_type, direction)→ returns a conversation object ornull.
-
-
Writes to:
-
msg.payload.has_recent_conversation(boolean) -
msg.payload.recent_conversation(object ornull)
-
-
Routing (two outputs):
-
Output 1: when
has_recent_conversation === true -
Output 2: when
has_recent_conversation === false
-
-
Behavior:
-
Logs progress.
-
On error: logs, calls
node.error(...), anddone(err); message is not forwarded.
-
-
Example:
-
Input:
payload = { customer_id: "123", channel_type: "CHAT", direction: "INBOUND" } -
Output fields added:
-
If found:
has_recent_conversation = true,recent_conversation = { ... }→ sent to output 1 -
If not:
has_recent_conversation = false,recent_conversation = null→ sent to output 2
-
-