docs: rewrite Label the incoming message with best practices#644
docs: rewrite Label the incoming message with best practices#644SangeetaMishr wants to merge 4 commits into
Conversation
…ractices The page was previously almost entirely a video embed that mostly covers other topics. Add an explanation of how the node actually works (it labels the contact's last incoming message), configuration steps, and the best practice of placing it right after a Wait for Response node so the label lands on the reply you actually want. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
📝 WalkthroughWalkthroughThe “Label the incoming message” documentation page now shows a 3-minute read time and July 2026 update metadata. Its content was reorganized into “How it works,” “Adding the node to your flow,” and “Note” sections covering placement and label usage. The embedded YouTube video was moved to a separate “Related video” section near the end of the page. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
🚀 Deployed on https://deploy-preview-644--glific-docs.netlify.app |
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|  | ||
|
|
||
| **For instance, if someone chooses English as their preferred language, you can label their message as 'English' and then generate charts for how many people chose English.** | ||
| ## Best practices |
There was a problem hiding this comment.
Added Note to line 29
| ## Best practices | ||
|
|
||
|  No newline at end of file | ||
| - Place this node right after a `Wait for Response` node if you want to label what the contact just typed. This guarantees the incoming message being labelled is the reply you're interested in, not an older message from earlier in the conversation. |
There was a problem hiding this comment.
Move this up point 1, which is line 23. Maybe something like "Tip - Place this...."
There was a problem hiding this comment.
- Add a
Label the incoming messagenode at the point in your flow where you want to categorize the contact's message.
Tip - Place this node right after a Wait for Response node if you want to label what the contact just typed. This guarantees the incoming message being labelled is the reply you're interested in, not an older message from earlier in the conversation.
Added in line 23
tanuprasad530
left a comment
There was a problem hiding this comment.
Added a couple of comments . Kindly review and incorporate them.
|
@tanuprasad530 re-worked on both the comments you added kindly review. |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/4`. Product Features/03. Flows/2. Flow Actions/07. Label the incoming
message.md:
- Line 25: Indent the “Tip - Place this node right after a Wait for Response
node…” paragraph beneath step 1 in the walkthrough, or format it as a nested
blockquote, so it remains part of the numbered-list item without disrupting the
list structure.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 950e4f2a-6da5-4313-97b6-5d091cf11961
📒 Files selected for processing (1)
docs/4. Product Features/03. Flows/2. Flow Actions/07. Label the incoming message.md
|
|
||
| 1. Add a `Label the incoming message` node at the point in your flow where you want to categorize the contact's message. | ||
|
|
||
| Tip - Place this node right after a `Wait for Response` node if you want to label what the contact just typed. This guarantees the incoming message being labelled is the reply you're interested in, not an older message from earlier in the conversation. |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
file='docs/4. Product Features/03. Flows/2. Flow Actions/07. Label the incoming message.md'
# Show the relevant section with line numbers.
sed -n '1,120p' "$file" | cat -nRepository: glific/docs
Length of output: 3250
🏁 Script executed:
#!/bin/bash
set -euo pipefail
file='docs/4. Product Features/03. Flows/2. Flow Actions/07. Label the incoming message.md'
sed -n '1,120p' "$file" | cat -nRepository: glific/docs
Length of output: 3250
🏁 Script executed:
#!/bin/bash
set -euo pipefail
file='docs/4. Product Features/03. Flows/2. Flow Actions/07. Label the incoming message.md'
sed -n '1,120p' "$file" | cat -nRepository: glific/docs
Length of output: 3250
🏁 Script executed:
#!/bin/bash
set -euo pipefail
python3 - <<'PY'
mods = ["markdown_it", "markdown", "commonmark", "mistune"]
for m in mods:
try:
__import__(m)
print(m, "available")
except Exception as e:
print(m, "missing")
PYRepository: glific/docs
Length of output: 225
🏁 Script executed:
#!/bin/bash
set -euo pipefail
python3 - <<'PY'
from markdown_it import MarkdownIt
md = MarkdownIt()
text = """1. Add a `Label the incoming message` node at the point in your flow where you want to categorize the contact's message.
Tip - Place this node right after a `Wait for Response` node if you want to label what the contact just typed. This guarantees the incoming message being labelled is the reply you're interested in, not an older message from earlier in the conversation.
2. Under `Select the labels to apply to the incoming message`, enter the name of an existing label or create a new one.
"""
tokens = md.parse(text)
for t in tokens:
print(t.type, t.tag, repr(t.content), t.markup, t.map)
PYRepository: glific/docs
Length of output: 911
Indent the tip under step 1. The one-space indent breaks the numbered list here; nest it beneath item 1 or format it as a blockquote so the walkthrough stays intact.
🧰 Tools
🪛 LanguageTool
[style] ~25-~25: You have already used this phrasing in nearby sentences. Consider replacing it to add variety to your writing.
Context: ...after a Wait for Response node if you want to label what the contact just typed. This...
(REP_WANT_TO_VB)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@docs/4`. Product Features/03. Flows/2. Flow Actions/07. Label the incoming
message.md at line 25, Indent the “Tip - Place this node right after a Wait for
Response node…” paragraph beneath step 1 in the walkthrough, or format it as a
nested blockquote, so it remains part of the numbered-list item without
disrupting the list structure.
Summary
Fixes #614
The
Label the incoming messagepage was almost entirely a video embed, and per the issue, ~80% of that video isn't about this node - the part where it's actually used doesn't demonstrate correct usage either.This replaces it with:
Wait for Responsenode so the label lands on the reply you actually want, what happens if there's no incoming message yet (no-op), that multiple labels combine rather than overwrite, and to keep label names consistent for reporting.Verification
Confirmed the node's actual behavior against
glific/glific:lib/glific/flows/action.ex-add_input_labelsexecution labelscontext.last_messagelib/glific/processor/consumer_flow.ex-last_messageis set to the contact's message specifically incontinue_current_context, which runs when a flow resumes after the contact replies (i.e., right after aWait for Responsenode completes)add_flow_label/2no-ops whenlast_messageisnil, confirming the node does nothing if there's no incoming message to attach a label toTest plan
Summary by CodeRabbit