Skip to content

Conversation

@icecrasher321
Copy link
Collaborator

Description

Readding what was accidentally deleted in #745

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added tests that prove my fix is effective or that my feature works
  • All tests pass locally and in CI (bun run test)
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules
  • I have updated version numbers as needed (if needed)
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

Security Considerations:

  • My changes do not introduce any new security vulnerabilities
  • I have considered the security implications of my changes

@vercel
Copy link

vercel bot commented Jul 23, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
sim ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 23, 2025 6:03pm
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
docs ⬜️ Skipped (Inspect) Jul 23, 2025 6:03pm

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

Greptile Summary

This PR restores critical webhook acknowledgment functionality that was accidentally removed in PR #745. The change modifies the processWebhook function in apps/sim/lib/webhooks/utils.ts to handle workflow execution asynchronously rather than synchronously.

The key modification converts the executeWorkflowFromPayload call from awaited (synchronous) to fire-and-forget (asynchronous) execution. This allows the function to immediately return a 200 HTTP response to webhook providers while the actual workflow execution continues in the background. The change also updates response messages from 'Webhook processed' to 'Webhook received' to accurately reflect the immediate acknowledgment behavior.

This pattern is essential for webhook reliability because most providers (WhatsApp, Telegram, Slack, etc.) expect immediate HTTP responses within 2-5 seconds to confirm receipt. Without timely acknowledgments, providers may retry webhooks or mark them as failed. The asynchronous execution maintains the webhook contract while ensuring workflows still execute properly in the background.

The implementation includes proper error handling via a .catch() block that logs any async execution errors without affecting the webhook response, ensuring providers always receive timely confirmations regardless of workflow execution outcomes.

Confidence score: 5/5

• This is a safe restoration of critical webhook functionality with proper error handling
• The change addresses a real operational issue where webhook providers could timeout waiting for responses
• All files show appropriate modifications with no obvious issues or side effects

1 file reviewed, no comments

Edit Code Review Bot Settings | Greptile

@icecrasher321 icecrasher321 changed the title fix(webhooks): read immediate acks fix(webhooks): readd immediate acks Jul 23, 2025
@icecrasher321 icecrasher321 merged commit 4197e50 into staging Jul 23, 2025
5 checks passed
@waleedlatif1 waleedlatif1 deleted the fix/webhooks-acks-readd branch July 27, 2025 01:34
arenadeveloper02 pushed a commit to arenadeveloper02/p2-sim that referenced this pull request Sep 19, 2025
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.

2 participants