Scheduling an API when DATA changes

Hello everyone,

I have a workflow that schedules an API when a user books an appointment. The API is to charge for the appointment at a later time (30 minutes after).

Within that time, I intend to give the client of the appointment the option to include a tip after the appointment is finished. As of now, they have a default tip option but I don’t want to limit or increase the professional user’s earnings depending on the service provided. So therefore I also want the client to have the option to add a one time tip for a specific appointment and not use the default tip.

My issue is that when the workflow runs, it records the data from the appointment at the time it was booked and not when the API is scheduled to run and charge the client. Therefore, it’s not calculating the tip that the client submitted after the appointment was booked. And I don’t want to run a separate workflow to charge the user for the tip because Stripe will take another fee.

Does anyone have an idea of how I can achieve this?

Thanks in advance.

Hey @gaffneyantonio,

When the tip value changes, you could cancel the first scheduled API and re-schedule one with the correct tip. That means you would need to store the first Scheduled API’s ID in your Appointment data type to retrieve it

That way you would only have one transaction from Stripe

1 Like

Ok, I will give this a try. Thanks for chiming in.

Where exactly do you capture the Scheduled API’s ID? Is it on the backend workflows? I’m having trouble understanding how exactly I would capture it.

@gaffneyantonio see the screenshots below:

Ok, Gotcha. I got to this point, but thought it was incorrect. I guess i was expecting further options after ‘result of step…’

Thank you so much.

1 Like