Skip to content

docs: enhance webhook documentation with response structure details a…#635

Open
priyanshu6238 wants to merge 4 commits into
mainfrom
feat/update_api_doc
Open

docs: enhance webhook documentation with response structure details a…#635
priyanshu6238 wants to merge 4 commits into
mainfrom
feat/update_api_doc

Conversation

@priyanshu6238

@priyanshu6238 priyanshu6238 commented Jun 26, 2026

Copy link
Copy Markdown
Collaborator

…nd examples

Summary by CodeRabbit

  • Documentation
    • Clarified the feature-research workflow with more specific guidance on when and how to consult backend behavior, and how to translate findings into user-facing language.
    • Added a documentation IA section explaining where to reference backend code for user-observable behavior verification, without documenting internal architecture.
    • Updated “Call a webhook” documentation (date, formatting, and examples) to require JSON responses, including object/array handling, nested value access, key-casing, and missing-value behavior.
    • Reformatted webhook log guidance for clearer readability.

@coderabbitai

coderabbitai Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The PR updates documentation guidance for researching backend behavior, including when to inspect backend code and how to describe findings. It also updates webhook documentation to allow JSON objects and arrays in responses, explain how response data is stored, and document nested value access syntax and lookup rules.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title matches the main change: webhook docs were expanded with response structure details and examples.
Description check ✅ Passed The description is brief but still directly related to the webhook documentation updates.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 markdownlint-cli2 (0.22.1)
docs/4. Product Features/03. Flows/2. Flow Actions/11. Call a webhook.md

markdownlint-cli2 wrapper config was not available before execution


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

Copy link
Copy Markdown

@github-actions github-actions Bot temporarily deployed to pull request June 26, 2026 09:54 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: 3

🤖 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/11. Call a webhook.md:
- Around line 76-84: Clarify the invalid-JSON behavior in the webhook response
section so flow authors know what happens after a parse failure. Update the “How
the response should be structured” guidance to state whether the webhook step in
the Call a webhook flow action still completes with an empty result or instead
errors/stops execution, and make that behavior explicit near the JSON parsing
rules in this document.
- Around line 126-128: The note in the Webhook documentation uses a relative
“below” reference that may not resolve reliably in rendered output; update the
text in the note near the Webhook Logs mention to either match the actual
section placement under the “Checking Webhook Logs” heading or replace “below”
with a direct anchor link to the Webhook Logs section. Use the existing note
block and the “Checking Webhook Logs”/“Webhook Logs” headings as the locating
symbols.
- Around line 122-125: The guidance for handling missing values uses the wrong
node name, so update the prose in the webhook flow docs to reference the exact
Glific UI label. In the section discussing checking whether a value exists
before use, replace the generic “split node” wording with “Split by a result in
the flow” and keep “Wait for result” unchanged so the branching instruction
matches the actual workflow node names.
🪄 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: 302a92b5-bf30-48d2-a303-d95f09596606

📥 Commits

Reviewing files that changed from the base of the PR and between 96d4ce2 and 5ebb4ec.

📒 Files selected for processing (3)
  • .claude/skills/documentation/SKILL.md
  • .claude/skills/documentation/workflow.md
  • docs/4. Product Features/03. Flows/2. Flow Actions/11. Call a webhook.md

Comment on lines +76 to +84
## How the response should be structured

When your external API replies to a webhook call, Glific reads the **JSON body** of the response and saves it under your webhook's result name. A few rules decide what you can read back:

- **Return JSON.** Glific only parses JSON response bodies. If the body is not valid JSON, nothing is saved to the result and the call is logged as an error.
- **A JSON object is the cleanest choice.** Every key in the object becomes a value you can read with **@results.YOUR_WEBHOOK_NAME.KEY**.
- **Arrays are supported too.** If your API returns a JSON array, Glific turns it into numbered keys starting at `0` — the first item is `0`, the second is `1`, and so on. You then read an item by its number.
- **There is no fixed nesting limit.** Glific keeps the full shape of your JSON — objects inside objects, arrays inside objects — so you can reach any value by following its path.

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 | 🔵 Trivial | ⚡ Quick win

Clarify what "nothing is saved" means for flow authors.

Line 80 states that invalid JSON means "nothing is saved to the result and the call is logged as an error." Consider clarifying whether the flow can still continue (with an empty result) or if the webhook node itself errors and stops flow execution. This distinction matters for authors designing error-handling paths.

🤖 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/11. Call a webhook.md
around lines 76 - 84, Clarify the invalid-JSON behavior in the webhook response
section so flow authors know what happens after a parse failure. Update the “How
the response should be structured” guidance to state whether the webhook step in
the Call a webhook flow action still completes with an empty result or instead
errors/stops execution, and make that behavior explicit near the JSON parsing
rules in this document.

Comment on lines +122 to +125
- **Array items are numbered from `0`.** The first item is always `0`, not `1`.
- **Match the keys exactly**, including upper- and lower-case. `@results.mywebhook.User.name` will not find `user`.
- **Check a value exists before you use it.** If a key is missing from the response, its path returns nothing. Use a **Wait for result** or a split node to branch on whether the value came back.

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.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify exact node type names in Glific documentation or codebase
rg -n "Wait for result" docs/
rg -n "split node" docs/
rg -n "Split by" docs/ --type md

Repository: glific/docs

Length of output: 9250


Update the specific node name for handling missing values.

While "Wait for result" is the correct node name, "split node" is too generic and does not match the Glific UI. The precise node for branching based on workflow results is Split by a result in the flow.

Replace "split node" with "Split by a result in the flow" in the guidance:

Use a Wait for result or a Split by a result in the flow node to branch on whether the value came back.

🤖 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/11. Call a webhook.md
around lines 122 - 125, The guidance for handling missing values uses the wrong
node name, so update the prose in the webhook flow docs to reference the exact
Glific UI label. In the section discussing checking whether a value exists
before use, replace the generic “split node” wording with “Split by a result in
the flow” and keep “Wait for result” unchanged so the branching instruction
matches the actual workflow node names.

@github-actions github-actions Bot temporarily deployed to pull request June 26, 2026 09:59 Inactive
@priyanshu6238 priyanshu6238 self-assigned this Jun 26, 2026
@github-actions github-actions Bot temporarily deployed to pull request June 26, 2026 10:16 Inactive
@priyanshu6238

priyanshu6238 commented Jun 26, 2026

Copy link
Copy Markdown
Collaborator Author

It doesn't look good to me, so I'm closing this for now.

@github-actions github-actions Bot temporarily deployed to pull request June 26, 2026 11:02 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: 5

♻️ Duplicate comments (2)
docs/4. Product Features/03. Flows/2. Flow Actions/11. Call a webhook.md (2)

119-119: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Use the precise Glific node name.

"split node" is too generic and does not match the Glific UI. The precise node for branching on workflow results is "Split by a result in the flow". Update:

Use a Wait for result or a Split by a result in the flow node to branch on whether the value came back.

🤖 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/11. Call a webhook.md at
line 119, The branching guidance in this section uses a generic node name that
does not match the Glific UI. Update the wording in the webhook flow action docs
to use the exact node name “Split by a result in the flow” alongside “Wait for
result,” so the sentence in this section references the correct workflow node
name consistently.

74-74: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Clarify what happens after invalid JSON.

The text states "nothing is saved to the result and the call is logged as an error" but does not clarify whether the flow step completes with an empty result (allowing the flow to continue) or whether the webhook node itself errors and stops execution. This distinction matters for authors designing error-handling paths.

🤖 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/11. Call a webhook.md
around lines 74, Clarify the invalid-JSON behavior in the webhook response
section so flow authors know what happens after a parse failure. Update the “How
the response should be structured” guidance to state whether the webhook step in
the Call a webhook flow action still completes with an empty result or instead
errors/stops execution, and make that behavior explicit near the JSON parsing
rules in this document.
🤖 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/11. Call a webhook.md at
line 74, Clarify the invalid-JSON behavior in the webhook response guidance so
authors know whether the Call a webhook step completes with an empty result or
errors and stops execution. Update the “How the response should be structured”
section near the JSON parsing rule for the webhook action, making the outcome
explicit for invalid JSON and keeping the wording aligned with the existing
“Return JSON” note.
🤖 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/11. Call a webhook.md:
- Around line 24-28: The “Call a webhook” flow text uses the wrong term for the
dropdown selection; update the step in the webhook docs to refer to the HTTP
method instead of “response type.” In the “Call a webhook” section, revise the
instruction around the POST selection so it clearly says to choose POST as the
HTTP method, matching the dropdown behavior and terminology used elsewhere in
the flow actions docs.
- Line 11: The current webhook description in the flow action docs mixes inbound
WhatsApp handling with the outbound behavior of Call a webhook. Update the
description in the webhook flow action documentation to clearly state that this
action sends data from a flow to an external API and can use the response in
later steps, using the “Call a webhook” terminology to avoid confusion with
WhatsApp message reception.
- Around line 137-146: The webhook logs field list has inconsistent formatting
and awkward wording in the “Status Code” and “Error” entries. Update the
“Webhook logs page” list in the Call a webhook documentation so the “Status
Code” label uses proper spacing before the dash, and rephrase the “Error”
description to a clearer, concise sentence such as indicating it is the error
message or NULL on success.
- Around line 47-49: The heading and example sentence in the webhook flow docs
are awkward and repetitive; update the section title near the “Use webhook
response” text to read naturally without “the” before “flows,” and rephrase the
sentence in the “Call a webhook” content to remove the “you... and you want to”
wording. Use the existing webhook-response section text as the target and keep
the meaning while making it concise and clear.
- Line 64: The webhook docs example in the “Call a webhook” flow action uses a
Markdown-emphasized wildcard placeholder that renders incorrectly. Update the
text around the `@results.mywebhook.*YOUR_RESPONSE_OBJECT_KEY*` example to avoid
italic formatting by either wrapping the placeholder in backticks or rephrasing
it with angle brackets, so the `*` is preserved as an intentional meta-symbol
when readers view the rendered documentation.

---

Duplicate comments:
In `@docs/4`. Product Features/03. Flows/2. Flow Actions/11. Call a webhook.md:
- Line 119: The branching guidance in this section uses a generic node name that
does not match the Glific UI. Update the wording in the webhook flow action docs
to use the exact node name “Split by a result in the flow” alongside “Wait for
result,” so the sentence in this section references the correct workflow node
name consistently.
- Line 74: Clarify the invalid-JSON behavior in the webhook response guidance so
authors know whether the Call a webhook step completes with an empty result or
errors and stops execution. Update the “How the response should be structured”
section near the JSON parsing rule for the webhook action, making the outcome
explicit for invalid JSON and keeping the wording aligned with the existing
“Return JSON” note.
🪄 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: 9744f649-2059-457d-8741-2232e563e24d

📥 Commits

Reviewing files that changed from the base of the PR and between 5ebb4ec and 248806b.

📒 Files selected for processing (1)
  • docs/4. Product Features/03. Flows/2. Flow Actions/11. Call a webhook.md

</table>
</h3>

**Webhook calls are used to communicate with third-party applications within flows. They allow NGOs to receive and handle incoming messages, delivery receipts and other events from WhatsApp in a seamless and automated manner.**

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.

📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

Clarify the webhook description.

The current description conflates Glific's role as a WhatsApp Business API client (receiving incoming messages and delivery receipts) with the flow action "Call a webhook," which makes outbound HTTP requests from a flow to external APIs. This could confuse readers about what the webhook flow action actually does.

Consider rephrasing to focus on outbound calls to external APIs, e.g.:

Webhook calls let flows send data to external APIs and use the response in subsequent steps.

🤖 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/11. Call a webhook.md at
line 11, The current webhook description in the flow action docs mixes inbound
WhatsApp handling with the outbound behavior of Call a webhook. Update the
description in the webhook flow action documentation to clearly state that this
action sends data from a flow to an external API and can use the response in
later steps, using the “Call a webhook” terminology to avoid confusion with
WhatsApp message reception.

Comment on lines +24 to +28
1. Choose to `Call a webhook` in the dropdown in node action.
1. Choose `POST` in response type.
1. Enter the `URL` where you want a Webhook connection.
1. Click on the `Post Body` tab.
1. Enter the variables which you want to pass through the webhook.

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

Use precise terminology for the HTTP method dropdown.

Line 25 says "Choose POST in response type" but the dropdown selects the HTTP method (GET/POST), not a "response type." Update to:

  1. Choose POST as the HTTP method.
🤖 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/11. Call a webhook.md
around lines 24 - 28, The “Call a webhook” flow text uses the wrong term for the
dropdown selection; update the step in the webhook docs to refer to the HTTP
method instead of “response type.” In the “Call a webhook” section, revise the
instruction around the POST selection so it clearly says to choose POST as the
HTTP method, matching the dropdown behavior and terminology used elsewhere in
the flow actions docs.

Comment on lines 47 to +49
# Use webhook response in the flows

1. Let&#39;s say you make a webhook call (by using the above steps) and you want to use the response variable in the flow.
1. Let&#39;s say you make a webhook call (by using the above steps) and you want to use the response variable in the flow.

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.

📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Fix awkward heading and repetitive phrasing.

  • Line 47: "Use webhook response in the flows" → "Use webhook response in flows" or "Using webhook responses in flows"
  • Line 49: Static analysis flagged repetitive "you... and you want to" phrasing. Rephrase for clarity, e.g.:

After making a webhook call with the steps above, you can use the response variables in the flow.

🧰 Tools
🪛 LanguageTool

[style] ~49-~49: You have already used this phrasing in nearby sentences. Consider replacing it to add variety to your writing.
Context: ...call (by using the above steps) and you want to use the response variable in the flow. ...

(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/11. Call a webhook.md
around lines 47 - 49, The heading and example sentence in the webhook flow docs
are awkward and repetitive; update the section title near the “Use webhook
response” text to read naturally without “the” before “flows,” and rephrase the
sentence in the “Call a webhook” content to remove the “you... and you want to”
wording. Use the existing webhook-response section text as the target and keep
the meaning while making it concise and clear.

Source: Linters/SAST tools

> Your webhook should return JSON. A JSON object is the simplest to work with, but arrays are also supported — see [How the response should be structured](#how-the-response-should-be-structured) below.

Then you can use that response as **@results.mywebhook.success_message** Or if you want to use any other variable then it will be **@results.mywebhook.*YOUR_RESPONSE_OBJECT_KEY**
Then you can use that response as **@results.mywebhook.success_message** Or if you want to use any other variable then it will be **@results.mywebhook.\*YOUR_RESPONSE_OBJECT_KEY**

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.

📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Escape or rephrase the wildcard placeholder.

The *YOUR_RESPONSE_OBJECT_KEY* uses asterisks that Markdown renders as italics, making the placeholder appear as @results.mywebhook.YOUR_RESPONSE_OBJECT_KEY without any visible wildcard marker. Readers may not realize * was intended as a meta-symbol. Use backticks or a different convention:

@results.mywebhook.<YOUR_RESPONSE_OBJECT_KEY>

or escape the asterisks: \*YOUR_RESPONSE_OBJECT_KEY\*

🤖 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/11. Call a webhook.md at
line 64, The webhook docs example in the “Call a webhook” flow action uses a
Markdown-emphasized wildcard placeholder that renders incorrectly. Update the
text around the `@results.mywebhook.*YOUR_RESPONSE_OBJECT_KEY*` example to avoid
italic formatting by either wrapping the placeholder in backticks or rephrasing
it with angle brackets, so the `*` is preserved as an intentional meta-symbol
when readers view the rendered documentation.

Comment on lines 137 to +146
1. Webhook logs page will show the results of your webhook calls with the below details
1. `Time` - Time of the webhook call.
1. `URL` - The URL which is used in webhook call.
1. `Status` - Success / Error
1. `Status Code`- Status code returned from the webhook call.
1. `Error` - Error is an error returned. NULL in the case of success
1. `Method` - GET / POST
1. `Request Header` - Request header of the webhook call
1. `Request JSON` - JSON of the webhook call
1. `Response JSON` - JSON response received from the webhook call.
1. `Time` - Time of the webhook call.
1. `URL` - The URL which is used in webhook call.
1. `Status` - Success / Error
1. `Status Code`- Status code returned from the webhook call.
1. `Error` - Error is an error returned. NULL in the case of success
1. `Method` - GET / POST
1. `Request Header` - Request header of the webhook call
1. `Request JSON` - JSON of the webhook call
1. `Response JSON` - JSON response received from the webhook call.

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.

📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Fix formatting and awkward phrasing in the log fields list.

  • Line 142: `Status Code`- → add space: `Status Code` -
  • Line 143: "Error is an error returned. NULL in the case of success" → rephrase to "Error message, or NULL if the call succeeded."
🤖 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/11. Call a webhook.md
around lines 137 - 146, The webhook logs field list has inconsistent formatting
and awkward wording in the “Status Code” and “Error” entries. Update the
“Webhook logs page” list in the Call a webhook documentation so the “Status
Code” label uses proper spacing before the dash, and rephrase the “Error”
description to a clearer, concise sentence such as indicating it is the error
message or NULL on success.

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.

1 participant