SMS Interval Alert

I’m struggling to send SMS messages on a scheduled interval. I’m currently using the HTTP body as a trigger for guests registering to an event. The registration form collects all of the information I need and then pushes the information to Twilio to send the SMS.

What I can’t figure out is how would I still use this same trigger to capture the registrant’s information but to only send an SMS alert on a scheduled date? I’ve used the Schedule trigger along with the HTTP body but the information is sent immediately upon registration and seemingly ignores the CRON schedule I have set up.

Is there a way I can leverage the webhook to collect the data AND only continue with the workflow based on the CRON schedule trigger?

Expected Behavior: Attendee registers and triggers SMS alert to send only according to CRON schedule.

Current Behavior - Attendee registers ignoring CRON schedule and sends SMS immediately.

Example Workflow

Hi @sharrod.smith,

To achieve the expected behavior where an attendee registers and triggers an SMS alert to send only according to a CRON schedule, you’ll need to adjust your workflow to incorporate a delay mechanism that aligns with your CRON schedule. The direct use of the Schedule trigger alongside an immediate action like sending an SMS via Twilio won’t inherently delay the SMS to match the CRON schedule, as the Schedule trigger is designed to initiate workflows based on the specified interval or CRON expression, not to delay actions within a workflow triggered by another event (like an HTTP request).

Given the constraints and the desired outcome, here’s a step-by-step solution using Pipedream’s capabilities:

  1. Capture Registration Data: Your initial workflow triggered by the HTTP request (the registration form submission) should capture the registrant’s information and store it for later use. You can use Pipedream’s built-in Data Stores to save this information temporarily.

  2. Schedule a Task for SMS Notification: Instead of trying to use the Schedule trigger to delay the SMS action directly, use the Pipedream Task Scheduler to schedule a task that will trigger another workflow at the desired time. This task will include the necessary information for sending the SMS, such as the phone number and message content.

  3. Create a Second Workflow for Sending SMS: This workflow will be triggered by the Task Scheduler at the scheduled time. It will read the information passed by the Task Scheduler (e.g., registrant’s phone number and message) and use the Twilio action to send the SMS.

Here’s an example of how you might set up the first part of this solution, storing registrant information in a Data Store:

export default defineComponent({
  props: {
    data: { type: "data_store" },
  },
  async run({ steps, $ }) {
    // Assuming `event.body` contains the registrant's information
    const registrantInfo = steps.trigger.event.body;
    
    // Generate a unique key for this registrant (e.g., using their email or phone number)
    const key = registrantInfo.email; // Adjust based on your data structure
    
    // Store registrant information for later retrieval
    await this.data.set(key, registrantInfo);
    
    // Now, schedule a task using

I'm a bot powered by Pipedream and GPT-4. I'm still learning, so please double-check my answers and code! [Learn how to build your own](https://pipedream.com/blog/build-your-own-chat-bot-with-openai-and-pipedream/).