Build features
Automations: schedules and webhooks
Run an app on its own: on a schedule, or when another service sends an event. Nothing runs between runs.
An automation runs your app without anyone opening it:
- On a schedule, like every weekday at 9:00: "post yesterday's deals to Slack every morning".
- When another service sends an event (a webhook): "when Fathom finishes recording a meeting, summarise it and post it to Slack".
Nothing runs between runs. At the scheduled time, or when the event arrives, your app starts, does the work, and stops. You pay nothing extra for the time in between.
Ask your AI tool
The easiest way is to ask, for example:
Make this app post a summary of yesterday's HubSpot deals to our Slack channel every weekday at 9:00 Dubai time, then put it live.
Your AI tool adds the automation to the app and deploys it. Keys like a Slack token go in the app's secrets, never in the code.
How it works: inhaus.json
Automations are declared in a file called inhaus.json at the root of the app's files:
{
"schedules": [
{ "name": "daily-summary", "cron": "0 9 * * 1-5", "timezone": "Asia/Dubai", "path": "/tasks/daily" }
],
"webhooks": [
{ "name": "fathom", "path": "/hooks/fathom" }
]
}| Field | What it is |
|---|---|
name | Lower-case letters, numbers and dashes. Optional for schedules. A webhook keeps its URL for as long as its name stays the same. |
cron | When a schedule runs: minute, hour, day of month, month, day of week. 0 9 * * 1-5 is 9:00 on weekdays; */15 * * * * is every 15 minutes. @hourly, @daily, @weekly and @monthly work too. |
timezone | The time zone the schedule follows, like Asia/Dubai or Europe/Amsterdam. UTC when you leave it out. |
path | The address in your app that does the work. |
An app can have up to 10 schedules and 10 webhooks. Every deploy that goes live reads the file again: new ones are added, changed ones updated, and ones no longer in the file removed. If the file has a mistake, the app keeps its current automations and the access log says what's wrong.
Your app's server code handles each path:
export default {
async fetch(request, env) {
const url = new URL(request.url);
if (url.pathname === '/tasks/daily') {
// Runs on the schedule (a POST). Do the work, then answer.
return new Response('done');
}
if (url.pathname === '/hooks/fathom') {
const event = await request.json(); // the other service's request, as it sent it
return new Response('ok');
}
return new Response('Not found', { status: 404 });
},
};Each run has the header x-inhaus-trigger set to schedule or webhook. A scheduled run is a POST with a small JSON body ({ "trigger": "…", "at": "…" }). A webhook passes on the other service's request: its method, body and headers.
The Automations tab
Open the app in Inhaus and go to Automations (owners, editors and admins). There you can:
- see each schedule in plain words ("Weekdays at 09:00 (Asia/Dubai)"), when it runs next and how its last run went
- Run now to try a schedule once
- copy each webhook URL to paste into the other service
- Replace URL if a webhook URL was shared somewhere it shouldn't be: the old one stops at once
- pause and resume an automation (owners and admins)
- read the last 50 runs, with the app's answer and how long it took. Runs are kept 30 days.
A run counts as failed when the app answers with an error (a 4xx or 5xx status) or doesn't answer within 60 seconds.
Webhook URLs are secrets
A webhook URL looks like https://<app>--<workspace>.inhaus.dev/__inhaus/hooks/<secret>. It's the one address that skips company sign-in, so anyone who has it can call that path. Only give it to the service that needs it, and replace it if it leaks. Viewers of the app can't see it.
To check that a request really comes from the other service, most services sign their webhooks (Stripe, GitHub, HubSpot and others). Keep the service's signing secret in the app's secrets and check the signature in your code.