Stripe Webhook says it works, but NO results in Bubble

I am using Stripe Webhook, I’ve tried events

  1. customer.subscription.created
  2. payment_intent.created
    Aim to triger them, I create subscription in Bubble.

Stripe says everything works

but, I get empty data in my workflow action

When triggering a workflow from an external source (such as from a Stripe webhook) you can’t use ‘current user’.

‘Current User’ is an internal Bubble concept which Stripe obviously doesn’t have, so it can’t send that into your workflow. Trying to run a webhook-triggered workflow on the ‘current user’, your app won’t know who the current user is, so it won’t work.

So you’ll need to have another way of identifying the user you want the workflow to run on, such as email address or unique ID. You’ll need to ensure that this data is being sent to Stripe in the original API call/plugin action so that you can retrieve it from the webhook’s request data.

Use ‘make changes to a thing’ instead of ‘make changes to current user’ and do a search for Users to match a user to the data (such as email address or unique ID) from the Request Data.

Also, be aware that, in any subsequent workflows being triggered by this one (if you have any) that you want to run on the same user, you’ll need to pass the User as a parameter so that those workflows will understand which user to run on (‘current user’ won’t work in those workflows either because there isn’t one).

2 Likes

I don’t understand.
Do you mean that I generally can’t use “Current User” at all in this specific workflow?

Yes that’s right. There is no ‘Current User’ when triggering a backend workflow via a webhook, so you’ll need to specify a specific user instead. Otherwise, any reference to ‘current user’, in any workflow actions, won’t know which user is being referred to, so those actions won’t run.

I just was afraid that based on your words, I can’t pull “Current User” to a recurring workflow as a parameter, but it seems it doesn’t work only with webhooks.

That’s right. If you trigger a backend workflow from the browser, the current user will be passed on and understood.

For example, if a user clicks a button on a page on your app which triggers a backend workflow to make changes to the current user, that will work fine.

But, when triggering a backend workflow from a webbook, the ‘current user’ will be empty, so you’ll need to specify the user from the request data.

If you need to refer to the same user in the same workflow again you can refer to the result’s of the step that first specified the user.

If you need to pass that user onto other workflows you’ll need to do so in a parameter (of type User).

1 Like

I’ve managed to retrieve when it’s not body object, but when event provides body object customer, it doesn’t work


This works:

“Include headers” helped, but
“next_action” body object is empty, it may be at least “null”

This topic was automatically closed after 70 days. New replies are no longer allowed.