PipedreamHQ / PipedreamHQ/pipedream

[BUG] Deploy with webhookUrl and updateWebhooks 500 on valid URL with base64url query; listWebhooks empty on polling triggers

Open
#18,239 0 comments 0 reactions 0 assignees View on GitHub
bug tracked internally triaged
Dominant language
JavaScript
Stars
11.7k
Forks
5.8k
Avg merge
3d 10h
Merged PRs (30d)
102

Description

**Description**
Setting webhookUrls on a deployed trigger intermittently returns a 500 from the Pipedream API when the URL includes a moderately sized base64url-encoded query param (mapping hint). Small URLs work; slightly larger-but-valid URLs fail. Also, deployedTriggers.listWebhooks often returns an empty list for polling triggers even after updateWebhooks reports success. Creating the trigger a url as described below fails. Creating a trigger without the same url works, but fails when trying to update with the same url.

**To Reproduce**
1. Using the v2 backend SDK, deploy a Gmail polling trigger for a user:
- id: gmail-new-email-received
- externalUserId: valid user id
- configuredProps:
- gmail.authProvisionId: apn_xxx
- timer.intervalSeconds: 60
- labels: ["INBOX"]
- withTextPayload: true
- triggerType: polling
2. Build a webhook URL to your server, e.g.:
`https://[host]/api/runWorkflow?sid=[uuid]&token=[signed]&m=[base64url-encoded JSON]`
- Works (short): m={"emailSummary":"$"} → mLength ~ 27, total URL length ~ 180

Fails (longer):
`m={"emailBody":"payload","emailHeader":"parsedHeaders","emailSubject":"parsedHeaders.subject","emailSender":"parsedHeaders.from.email","emailDatetime":"parsedHeaders.date"}`

`→ mLength ~ 227, total URL length ~ 380`

3. Attempt to attach the webhook URL:
- Path A (preferred): `pd.triggers.deploy({ ..., webhookUrl })`
- Path B (fallback): `pd.deployedTriggers.updateWebhooks(triggerId, { webhookUrls: [webhookUrl] })`

4. Observe:
- Path B frequently returns 500 with body:
`{ "error": "Unexpected error, please reach out to our team at https://pipedream.com/support" }`

- Path A sometimes succeeds; when it does, updateWebhooks also returns success later, but…
`pd.deployedTriggers.listWebhooks(triggerId)` often returns [] even when updateWebhooks reports the URL set.

**Minimal logs highlighting both cases:**
```
[webhookUrl] Built target URL https:///api/runWorkflow?sid=...&token=...&m=eyJlbWFpbFN1bW1hcnkiOiIkIn0
[webhookUrl] Lengths { totalLength: 183, hasM: true, mLength: 27 }
✅ Applied webhookUrl via updateWebhooks. Response: { "webhookUrls": ["https:///api/runWorkflow?...&m=..."] }

[webhookUrl] Built target URL https:///api/runWorkflow?sid=...&token=...&m=eyJlbWFpbEJvZHkiOiJwYXlsb2FkIiwiZW1haWxIZWFkZXIiOiJwYXJzZWRIZWFkZXJzIiwiZW1haWxTdWJqZWN0IjoicGFyc2VkSGVhZGVycy5zdWJqZWN0IiwiZW1haWxTZW5kZXIiOiJwYXJzZWRIZWFkZXJzLmZyb20uZW1haWwiLCJlbWFpbERhdGV0aW1lIjoicGFyc2VkSGVhZGVycy5kYXRlIn0
[webhookUrl] Lengths { totalLength: 383, hasM: true, mLength: 227 }
⚠️ Failed to set webhook via updateWebhooks: Status code: 500
Body: { "error": "Unexpected error, please reach out to our team at https://pipedream.com/support" }
```

**Expected behavior**
- `deployedTriggers.updateWebhooks` and/or deploying with `webhookUrl` should accept valid HTTPS URLs (with standard query params) without 500s, even when a query param is ~200–300 chars base64url.
- `deployedTriggers.listWebhooks` should reliably reflect webhook URLs set on the trigger, or documentation should state when/why polling triggers won’t report them.

**Screenshots**
- N/A (server logs attached above). Can provide additional logs on request.

**Additional context**
- SDK: `@pipedream/sdk` v2, `PipedreamEnvironment.Prod`
- Trigger: `gmail-new-email-received` (polling), Connect Managed Auth via `authProvisionId`
- Behavior observed both when attaching via deploy-time `webhookUrl` and via `deployedTriggers.updateWebhooks`
- The same endpoint and webhook URL succeed when the m param is short (`{"emailSummary":"$"}`), but fail with a modestly larger mapping JSON (~227 chars base64url).
- `listWebhooks` frequently returns empty arrays for these polling triggers even right after a successful `updateWebhooks` response that echoes the URL.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.