Having trouble with setting up a scheduled (recurring?) workflow

Hello,
I’m building a marketplace app and have structured my payment flow to take a payment when a booking is made and put the funds in my account and then when the refundable period has passed then transfer those funds (minus my fees) to the correct seller. Ive got the stripe api calls and everything sorted but I just can’t figure out how to schedule the transfer out part.

The funds are held by me until 48 hours before the booking time. At that time the funds are supposed to be transferred to the seller but I just can’t seem to figure out how to do this in the backend workflows. Since it has to run on a whole list of bookings I have tried to implement some ways I have seen on the forum but they all seem to be for a specific date. These bookings are obviously all at different times so it can’t be for just the one time. And there is also the possibility for bookings to be rescheduled so how do I ensure the workflow happens on the new date and not the old one?

Any help is greatly appreciated

Hi, I think you’ve got 2 options here :

  1. Scheduled your workflow that transfers the funds (minus fees) on the date: [booking date] +days (-2)
    :point_right: Put this action in your initial booking workflow and stock the id of the workflow (result of the step schedule api workflow) in the booking for instance
    :point_right: And put it in the workflow that allows rescheduling after you put an action cancel a scheduled workflow

  2. Set a recurring workflow that triggers every 24h with a schedule API workflow on a list that use the API workflow that transfers funds
    :point_right: list is a do search of your bookings with booking date < current date +1 days and booking date > current date. With this you will get all your bookings with a booking date in the next day.

Hope this help :slight_smile:

I’ve been doing something similar and think I just figured it out. I posted a walkthrough in the original thread.

For the scheduling of individual payouts, you can add a field on whatever Thing your payout action will monitor. This field could be a “payout date” that is set when the booking is originally created (or later modified).

And/Or you could create a “Payout allowed” field on the booking of type yes/no and check that field as part of the search that builds the list as the scheduled workflow runs (which would allow you to stop the payout of individual bookings pretty easily, without impacting the others).

Thank you both for the replies. I followed @eliot1 's advice by setting a deadline and then scheduling the api workflow for that deadline which is working correctly. I think I may have been overthinking it earlier, below are some screenshots of my setup for reference:

When the charge is confirmed as successful via the webhook a booking is made and the schedule is set for the next API workflow

When the time comes the API then runs the transfer of funds

My newest issue is the transfer api call itself. If either of you can spot something I have done incorrectly you’d be a life saver but essentially the call is not sending the correct amount to be transferred, its only using the data that is in the API call template and not the dynamic amount I have entered.

In the screenshot below you can see that I have the amount as a dynamic figure:

But the call itself is only ever inputting the api call amount which the call logs confirm:


Its strange because the artists stripe ID changes dynamically and I have tried entering the amount as a number and as text but neither make a difference. Any ideas?

Cool if it helped! :+1:

For the amount, if you use Stripe API your amount should be in cent. So your Transfer Amount cannot contains “.” so 2 options:
:point_right: the transfer amount is stocked in cent, just call it (102858)
:point_right: the transfer amount is stocked with “.”, call it and multiply by 100 (1028.58 x 100)

Hope this help :slight_smile:

Its not entering a number at all which is the problem. Just weird since the other parameters are working just fine :man_shrugging: