Auto expiration

Hi @debemghf, happy to help here.

The best way to achieve this is with API Workflows. Heads up, you’ll need to be on a paid plan for API Workflows to work in your app.

First, enable API Workflows: Go to Settings > API > Expose Workflow API. Now, you’ll see “API Workflows” available in your page dropdown list (upper left). Here’s a video that will help walk you through this further: https://www.youtube.com/watch?v=RbQCCZfdzes

Then, you’ll need to create an API Endpoint (in this new API Workflows area). Name it whatever you want - something like “expired-account.”

Add a parameter to the endpoint called “user,” and the parameter type = User

Add an action for this workflow: Delete thing > Thing to delete = user (parameter)

Now, in the signup workflow (from whatever page that happens on), add an action at the end “Schedule an API Workflow”:

  • API workflow = “expired-account”
  • Schedule date = Current date/time +(months): 1
  • User = Current User

So, when a user signs up, it will schedule the API Endpoint to run in a month. At that time, it will delete the account.

Now, very important - you need to be able to CANCEL this workflow if the user wants to keep their account active before the expiration date. So, best thing to do is SAVE the scheduled workflow ID. In the sign up workflow, AFTER the “Schedule an API Workflow” action, add an action to Make a Change to Current User: Expiration API ID = Result of previous step. “Expiration API ID” should be a text field under the User type.

Wherever you decide to use to trigger this cancellation (maybe the completion of a user profile or the confirmation of their email address), you’ll want to run the action “Cancel a Scheduled API Workflow” and provide the Current User’s Expiration API ID as the ID to cancel. Here’s a video on the API IDs: https://www.youtube.com/watch?v=ZoPQd2z_pBM

I hope this helps!


Gaby at Coaching No Code Apps (formerly Coaching Bubble)

Courses & Products, Tutorials, Private Coaching, and High-level Development

Start Learning Today :mortar_board:

7 Likes