Help

The Community will be temporarily unavailable starting on Friday February 28. We’ll be back as soon as we can! To learn more, check out our Announcements blog post.

Can one automation be triggered in multiple ways?

Topic Labels: Automations
Solved
Jump to Solution
1078 2
cancel
Showing results for 
Search instead for 
Did you mean: 
VictorN
5 - Automation Enthusiast
5 - Automation Enthusiast

E.g. I want an automation be triggered every Monday OR over webhook.

 

1 Solution

Accepted Solutions
Alexey_Gusev
13 - Mars
13 - Mars

Hi,
example script step to call webhook. You should define variables for payload in the left panel of code editor. And set correct webhook URL, of course.

let config=input.config()
let payload=JSON.parse(JSON.stringify(config))
console.log(payload)
const WHCentral='https://hooks.airtable.com/workflows/v1/genericWebhook/app_PUTlinkTOwebhookHERE'
const options={method:'POST',body:JSON.stringify(payload),headers:{'Content-Type': 'application/json'}}
const responce=await fetch(WHCentral,options);
const result=(responce.ok)? await responce.json() : responce.statusText;
console.log(result)

 

See Solution in Thread

2 Replies 2
kuovonne
18 - Pluto
18 - Pluto

Nope. Cannot be done with a single automation. You can have the main automation triggered by webhook. Then have a second automation that runs on a schedule and calls the webhook. That way the main logic is in only one place. But you still need to automations. 

Alexey_Gusev
13 - Mars
13 - Mars

Hi,
example script step to call webhook. You should define variables for payload in the left panel of code editor. And set correct webhook URL, of course.

let config=input.config()
let payload=JSON.parse(JSON.stringify(config))
console.log(payload)
const WHCentral='https://hooks.airtable.com/workflows/v1/genericWebhook/app_PUTlinkTOwebhookHERE'
const options={method:'POST',body:JSON.stringify(payload),headers:{'Content-Type': 'application/json'}}
const responce=await fetch(WHCentral,options);
const result=(responce.ok)? await responce.json() : responce.statusText;
console.log(result)