Skip to content

Conversation

@priyanshu6238
Copy link
Collaborator

@priyanshu6238 priyanshu6238 commented Dec 29, 2025

Summary:
Add custom webhook json
for more details - glific/floweditor#194
flow editor pr: glific/floweditor#193

Added a custom webhook JSON. In the frontend, when a user selects it from the dropdown, the option becomes editable, allowing both the label name and the body to be edited in this option

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 29, 2025

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

📝 Walkthrough

Walkthrough

A new webhook entry named "custom_webhook" is added to the webhook.json configuration file. The entry contains an empty JSON body and specifies the Content-Type header as application/json. It is positioned after the existing "create_certificate" entry within the webhook array, extending the list of available webhook handlers.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Possibly related PRs

  • JSON for webhook node #4473: Introduces the webhook.json file structure that is being extended by this PR with the new "custom_webhook" entry.
  • Fix/webhook json #4597: Standardizes webhook payload formats in webhook.json, relevant to maintaining consistency with the newly added webhook entry.

Suggested reviewers

  • madclaws
  • shijithkjayan
  • AmishaBisht

Poem

🐰 A webhook hops into our flows so bright,
Custom and ready, Content-Type just right,
Empty and eager, awaiting its call,
Our JSON array grows proud and tall!

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Add custom webhook json' directly describes the main change: adding a new custom_webhook entry to webhook.json.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description check ✅ Passed The pull request description clearly relates to the changeset, explaining the addition of a custom webhook JSON entry and its intended frontend functionality.

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 and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
priv/data/flows/webhook.json (1)

80-86: Add response format example for consistency and clarify the webhook's purpose.

The new "custom_webhook" entry is missing a response_format_example field that all other webhook entries include. This field serves as important documentation for users to understand the expected response structure.

Additionally:

  • The empty body "{}" appears intentional for a customizable template, but this should be verified.
  • The purpose and use case for this webhook are not documented in the PR description. Consider adding:
    • Documentation explaining when and how to use this webhook
    • Example use cases or scenarios
    • Whether this is meant as a user-customizable template
🔎 Suggested addition
   {
     "name": "custom_webhook",
     "body": "{}",
     "headers": {
       "Content-Type": "application/json"
-    }
+    },
+    "response_format_example": "{\"success\": true, \"message\": \"Custom webhook response\"}"
   }

Verification questions:

  1. Is the empty body "{}" intentional for user customization?
  2. What is the intended use case for this webhook?
  3. Should there be accompanying documentation explaining how users should customize this webhook?
📜 Review details

Configuration used: Path: https://storage.googleapis.com/cc-tides/glific_v2/.coderabbit.yaml (via .coderabbit.yaml)

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 961a23b and 9c4af68.

📒 Files selected for processing (1)
  • priv/data/flows/webhook.json
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: test (1.18.3, 27.3.3)

"response_format_example": "{\"certificate_url\": \"https://storage.googleapis.com/glific-media-bucket/certificate_id_5_contact_12345.png\", \"success\": true}"
},
{
"name": "custom_webhook",
Copy link
Member

Choose a reason for hiding this comment

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

What the need for custom webhook?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done: All attachments have been added to the issue and the Flow Editor PR

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@shijithkjayan
Copy link
Member

Please create a ticket for this and also add a proper description for the PR @priyanshu6238

@priyanshu6238 priyanshu6238 linked an issue Dec 30, 2025 that may be closed by this pull request
@priyanshu6238 priyanshu6238 marked this pull request as draft January 2, 2026 12:01
@priyanshu6238
Copy link
Collaborator Author

priyanshu6238 commented Jan 2, 2026

closeing this will immediately make the custom method available in the dropdown while the user is label is not present in the dropdown

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.

[Feature]: Support Custom Function Webhook JSON

3 participants