Skip to content

docs: rewrite Label the incoming message with best practices#644

Open
SangeetaMishr wants to merge 4 commits into
mainfrom
docs/label-incoming-message-best-practices
Open

docs: rewrite Label the incoming message with best practices#644
SangeetaMishr wants to merge 4 commits into
mainfrom
docs/label-incoming-message-best-practices

Conversation

@SangeetaMishr

@SangeetaMishr SangeetaMishr commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes #614

The Label the incoming message page 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:

  • How it works: explains that the node labels the contact's last incoming message, not any bot-sent message.
  • Adding the node to your flow: concrete configuration steps against the existing "Add Labels" screenshot.
  • Best practices: the specific guidance requested in the issue - place this node right after a Wait for Response node 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.
  • Keeps the video, but demoted to a "Related video" section at the bottom with a caveat that it's a broader flow-building walkthrough rather than being about this node specifically.

Verification

Confirmed the node's actual behavior against glific/glific:

  • lib/glific/flows/action.ex - add_input_labels execution labels context.last_message
  • lib/glific/processor/consumer_flow.ex - last_message is set to the contact's message specifically in continue_current_context, which runs when a flow resumes after the contact replies (i.e., right after a Wait for Response node completes)
  • add_flow_label/2 no-ops when last_message is nil, confirming the node does nothing if there's no incoming message to attach a label to
  • Existing labels and new labels are comma-joined rather than replaced

Test plan

  • Docs site renders the new sections and image correctly
  • Reviewer confirms this matches the intended usage pattern for this node

Summary by CodeRabbit

  • Documentation
    • Updated the “Label the incoming message” page to set the read-time estimate to 3 minutes.
    • Refreshed the page layout with clearer sections: How it works, Adding the node to your flow (step-by-step), and Best practices / Notes.
    • Moved the tutorial video into a dedicated Related video section near the end for better separation of guidance and media.

…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>
@coderabbitai

coderabbitai Bot commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The “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)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the documentation rewrite for this flow action with best practices.
Description check ✅ Passed The description directly explains the doc update, best-practice guidance, and video relocation, matching the change.
Linked Issues check ✅ Passed The docs now include best practices and explicitly recommend placing the node after Wait for Response, satisfying #614.
Out of Scope Changes check ✅ Passed The edits stay within the documentation page and related metadata/video placement, with no unrelated changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Jul 4, 2026

Copy link
Copy Markdown

@github-actions
github-actions Bot temporarily deployed to pull request July 4, 2026 12:33 Inactive
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@github-actions
github-actions Bot temporarily deployed to pull request July 4, 2026 13:00 Inactive
![Add Labels node showing the label selection field](https://user-images.githubusercontent.com/32592458/218254849-f5049dcb-4c84-4250-b235-efec35a43360.png)

**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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename this to Note.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added Note to line 29

## Best practices

![image](https://user-images.githubusercontent.com/32592458/218254849-f5049dcb-4c84-4250-b235-efec35a43360.png) 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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move this up point 1, which is line 23. Maybe something like "Tip - Place this...."

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  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.

Added in line 23

@tanuprasad530 tanuprasad530 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a couple of comments . Kindly review and incorporate them.

@SangeetaMishr

Copy link
Copy Markdown
Contributor Author

@tanuprasad530 re-worked on both the comments you added kindly review.

@github-actions
github-actions Bot temporarily deployed to pull request July 15, 2026 16:47 Inactive

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between bde3bda and 165b535.

📒 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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 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 -n

Repository: 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 -n

Repository: 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 -n

Repository: 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")
PY

Repository: 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)
PY

Repository: 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Label an incoming message node - Update documentation

3 participants