# Scheduled custom event doesn't run after Stripe Charge

**URL:** <https://forum.bubble.io/t/scheduled-custom-event-doesnt-run-after-stripe-charge/11330>\
**Category:** Bugs\
**Created:** [March 14, 2017, 11:03am UTC](https://forum.bubble.io/t/scheduled-custom-event-doesnt-run-after-stripe-charge/11330 "2017-03-14T11:03:53Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![pnodseth](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/pnodseth/32/2611_2.png) [@pnodseth](https://forum.bubble.io/u/pnodseth)\
**Post date:** [March 14, 2017, 11:03am UTC](https://forum.bubble.io/t/scheduled-custom-event-doesnt-run-after-stripe-charge/11330/1 "2017-03-14T11:03:53Z")

</div>

I’ve seen some cases now where a scheduled custom event doesn’t run after a Stripe charge.  
It doesn’t happen every time, but I have a feeling it happens after the Stripe charge has been completed on mobile devices.  
The workflow is like this:  
A) Charge a user  
B) Make changes to a thing  
C) Schedule custom event (0 sec after)  
D) Go to page

Step A,B,D works like normal, but the custom event doesn’t trigger.  
There are no conditional statements on the workflow or actions.

@emmanuel have you had other reports about this ?

---

<div class="post-metadata">

**Author:** ![nicolas.daprigny](https://avatars.discourse-cdn.com/v4/letter/n/b38774/32.png) [@nicolas.daprigny](https://forum.bubble.io/u/nicolas.daprigny)\
**Post date:** [March 14, 2017, 11:31am UTC](https://forum.bubble.io/t/scheduled-custom-event-doesnt-run-after-stripe-charge/11330/2 "2017-03-14T11:31:26Z")

</div>

I already had several not-runned actions after a Stripe’s charge. To be sure you don’t miss any one, I’d advice anyone to create a “Stripe\_Charge” object from yan API endpoint triggered by _charge.created_ (webhook) so you’re sure every Stripe\_Charge is linked to a Transaction you created before the charge action.

---

<div class="post-metadata">

**Author:** ![pnodseth](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/pnodseth/32/2611_2.png) [@pnodseth](https://forum.bubble.io/u/pnodseth)\
**Post date:** [March 14, 2017, 11:58am UTC](https://forum.bubble.io/t/scheduled-custom-event-doesnt-run-after-stripe-charge/11330/3 "2017-03-14T11:58:43Z")

</div>

Interesting. Do you know if it has only occured on mobile devices?

---

<div class="post-metadata">

**Author:** ![emmanuel](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/emmanuel/32/27657_2.png) [@emmanuel](https://forum.bubble.io/u/emmanuel)\
**Post date:** [March 14, 2017, 1:07pm UTC](https://forum.bubble.io/t/scheduled-custom-event-doesnt-run-after-stripe-charge/11330/4 "2017-03-14T13:07:31Z")

</div>

Yeah that’s what we do as well for our own app.

@pnodseth did you check Stripe’s logs? They can show the response from the webhooks

---

<div class="post-metadata">

**Author:** ![pnodseth](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/pnodseth/32/2611_2.png) [@pnodseth](https://forum.bubble.io/u/pnodseth)\
**Post date:** [March 14, 2017, 1:42pm UTC](https://forum.bubble.io/t/scheduled-custom-event-doesnt-run-after-stripe-charge/11330/5 "2017-03-14T13:42:51Z")

</div>

I think this is actually a bug, filing a bug report now.

I created a workflow with the following:

1. Stripe charge
2. Send email
3. Schedule a custom event (0 sec after) - The custom event also sends an email  
4)Send email

When running the workflow on a laptop, I recieve all 3 emails.  
When running it from mobile, I recieve only the email before and after the triggered custom event.

---

<div class="post-metadata">

**Author:** ![gf\_wolfer](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/gf_wolfer/32/262456_2.png) [@gf\_wolfer](https://forum.bubble.io/u/gf_wolfer)\
**Post date:** [March 14, 2017, 2:12pm UTC](https://forum.bubble.io/t/scheduled-custom-event-doesnt-run-after-stripe-charge/11330/6 "2017-03-14T14:12:45Z")

</div>

Sounds like a good idea. I may be way out in left field on how to implement that, but I’ll take a random shot.

I would create an API Endpoint in my app, called “Stripe\_Charge”  
This endpoint would have an Action “Make Changes to My App Receipt”, and the change would be something that acknowledges the API workflow ran

Then in the workflow with the Transaction, in the last Action, I Schedule the Workflow “Stripe\_charge” to run Only When Result of Step 1’s (the Stripe charge) charge\_id is not empty?

I am probably off somewhere, as I am unsure how to take a _charge.created_ (webhook) and trigger an action based off it?

And then to track these and know when to take action, do you have a List of Transactions that have processed without that last API workflow having run?

---

<div class="post-metadata">

**Author:** ![nicolas.daprigny](https://avatars.discourse-cdn.com/v4/letter/n/b38774/32.png) [@nicolas.daprigny](https://forum.bubble.io/u/nicolas.daprigny)\
**Post date:** [March 14, 2017, 11:56pm UTC](https://forum.bubble.io/t/scheduled-custom-event-doesnt-run-after-stripe-charge/11330/7 "2017-03-14T23:56:29Z")

</div>

Hi,  
From your webhook you get the Charge ID. You create a unique StripeCharge object for each Charge ID.  
Then you make a Do a search for Transaction which get the Charge ID as a Result of the charge action.  
If you have one Transaction for each StripeCharge, you’re good.  
Does it help ?

---

<div class="post-metadata">

**Author:** ![gf\_wolfer](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/gf_wolfer/32/262456_2.png) [@gf\_wolfer](https://forum.bubble.io/u/gf_wolfer)\
**Post date:** [March 15, 2017, 2:02am UTC](https://forum.bubble.io/t/scheduled-custom-event-doesnt-run-after-stripe-charge/11330/8 "2017-03-15T02:02:22Z")

</div>

Got it, thanks!

---

<div class="post-metadata">

**Author:** ![pnodseth](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/pnodseth/32/2611_2.png) [@pnodseth](https://forum.bubble.io/u/pnodseth)\
**Post date:** [March 15, 2017, 7:27am UTC](https://forum.bubble.io/t/scheduled-custom-event-doesnt-run-after-stripe-charge/11330/9 "2017-03-15T07:27:05Z")

</div>

So if I’m understanding you correctly;  
All the things you want updated after a successful charge, you trigger from the charge.created webhook?  
Let’s say I have a customer paying for a booking. When the charge is successful, the charge.created webhook triggers an API endpoint which searches for the booking with the same charge ID, and then updates the necessary fields?

---

<div class="post-metadata">

**Author:** ![nicolas.daprigny](https://avatars.discourse-cdn.com/v4/letter/n/b38774/32.png) [@nicolas.daprigny](https://forum.bubble.io/u/nicolas.daprigny)\
**Post date:** [March 15, 2017, 3:38pm UTC](https://forum.bubble.io/t/scheduled-custom-event-doesnt-run-after-stripe-charge/11330/10 "2017-03-15T15:38:33Z")

</div>

Perfectly, this is what I do.  
If the original transaction is not found I send myself an alert

---

<div class="post-metadata">

**Author:** ![pnodseth](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/pnodseth/32/2611_2.png) [@pnodseth](https://forum.bubble.io/u/pnodseth)\
**Post date:** [March 16, 2017, 1:55pm UTC](https://forum.bubble.io/t/scheduled-custom-event-doesnt-run-after-stripe-charge/11330/11 "2017-03-16T13:55:23Z")

</div>

Clever! I’ve set it up this way now, so that the endpoint is triggered from the charge.successful webhook.  
But, something really weird is happening 🙂  
Seems like the endpoint is being triggered several times every minute, and has been for the last 16 hours or so.Wish that was all successful transactions 😛  
There’s something triggering the endpoint, and I have no idea what it is.  
So I now have an INSANE amount of scheduled workflows waiting to be deleted, haha.  
I cannot see anything about it in the stripe logs. Do you know what might make it behave this way?

Update: I deleted the endpoint URL from Stripe, and it has stopped, it seems.  
Trying to re-add it, let’s see what happens…

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/bubble/original/3X/2/8/2847faa74692c2ffa5d939d3dc3724cdd060d247.png) [@system](https://forum.bubble.io/u/system)\
**Post date:** [March 28, 2017, 11:04am UTC](https://forum.bubble.io/t/scheduled-custom-event-doesnt-run-after-stripe-charge/11330/12 "2017-03-28T11:04:04Z")

</div>

Closed on March 28, 2017, 11:04am UTC

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