Webhook to set cron

I’ve a webhook that gets a date and time frequency (daily, weekly, monthly) from values posted to it from a web form.

I want to use the time and frequency to set when a Twilio nodeis triggered.

For instance, the form sends “Daily” and “5pm”

How can I have that webhook set the cron for when to trigger the Twilio node?

Welcome to the community @presence!

There is currently no node in n8n that allows you to create a new workflow and activate it. So what you want to do will be more work. What you have to do, is more or less:

  • build the workflow you want to get created each time
  • take its JSON representation and dynamically replace the custom cron expression depending on the incoming data of the Webhook
  • send that workflow JSON via an HTTP Request node to the internal n8n API (the one the frontend uses) to create that workflow
  • use another HTTP Request node to use again the internal API to activate that workflow

Hope that is helpful!

Hi, @jan. Thank you for your insights.

Is there a recipe, tutorial, or walk through that would show me how to trigger a Twilio node at a specific time of day, daily? Perhaps a cron to Twilio loop? Something like this:

webform → webhook → cron → Twilio

I have noted that to do truly dynamic crons, I’ll have to automate the workflow creation process, with the new values each time, and since it’s a simple date+time+frequency thing, I’m pretty sure I can template the JSON and send it over as a nice clean payload accordingly.

I’m actually stuck on getting the webhook-cron-Twilio basics dialed in :slight_smile:

Once I get my head around how to map the values correctly in sequence, I’m pretty sure an entire world of automation possibilities will open up for me :stuck_out_tongue: