How to dynamically switch off a backend workflow?

Users have the option to sign up for a paid subscription immediately, or use a code for a two-week free trial. If a free trial is applied, the User’s company’s Plan Status is “Trial” which gives them access, but after two weeks this status returns to ‘Empty Subscription’ .

To achieve this, I have a backend workflow on the subscription page which triggers to set the Status back to ‘Empty Subscription’ after two weeks.

Backend workflow

This is triggered after two weeks

My question is, what happens if a user subscribes to a plan midway through the trial? I don’t want them to start on a paid plan and then have their Status set to ‘Empty Subscription’ because of the backend workflow.

I need to ‘switch off’ the backend workflow before it triggers. How do I do this?

As long as you’ve stored the workflow ID you can cancel it using ‘Cancel a Scheduled Workflow’.

That said, it might be more reliable to use webhooks from whatever payment service you’re using to make these updates… then just change the Status in your database based on the events sent from the webhooks.

1 Like

Another option is to simply leave the scheduled workflow and add a condition to run it only if the user has not started a paid subscription

3 Likes

Ah, yes the webhook is the best solution, thank you!

That’s a good idea, I might add that as well as a webhook solution.