---
title: "Deploy Cron Webhook Trigger"
description: "Trigger authenticated HTTP endpoints on a schedule"
category: "Automation"
url: https://railway.com/deploy/cron-webhook-trigger
---

# Deploy Cron Webhook Trigger

Trigger authenticated HTTP endpoints on a schedule

**[Deploy Cron Webhook Trigger on Railway](https://railway.com/template/cron-webhook-trigger)**

- **Creator:** Joey Chilson
- **Category:** Automation
- **Total deploys:** 16

## Template content

### cron-job

- **Image:** ghcr.io/railwayapp/function-bun:1.3.0
- **Start command:** `./run.sh Y29uc3QgY3JvblNlY3JldCA9IGltcG9ydC5tZXRhLmVudi5DUk9OX1NFQ1JFVDsKY29uc3QgZW5kcG9pbnRVcmwgPSBpbXBvcnQubWV0YS5lbnYuRU5EUE9JTlRfVVJMOwoKdHJ5IHsKICBjb25zdCByZXNwb25zZSA9IGF3YWl0IGZldGNoKGVuZHBvaW50VXJsLCB7CiAgICBtZXRob2Q6ICJQT1NUIiwKICAgIGhlYWRlcnM6IHsKICAgICAgQXV0aG9yaXphdGlvbjogYEJlYXJlciAke2Nyb25TZWNyZXR9YCwKICAgICAgIkNvbnRlbnQtVHlwZSI6ICJhcHBsaWNhdGlvbi9qc29uIiwKICAgIH0sCiAgfSk7CgogIGNvbnN0IGRhdGEgPSBhd2FpdCByZXNwb25zZS5qc29uKCk7CgogIGNvbnNvbGUubG9nKAogICAgSlNPTi5zdHJpbmdpZnkoewogICAgICBsZXZlbDogcmVzcG9uc2Uub2sgPyAiaW5mbyIgOiAiZXJyb3IiLAogICAgICBtZXNzYWdlOiByZXNwb25zZS5vayA/ICJDcm9uIGpvYiBjb21wbGV0ZWQiIDogIkNyb24gam9iIGZhaWxlZCIsCiAgICAgIHN0YXR1czogcmVzcG9uc2Uuc3RhdHVzLAogICAgICBkYXRhLAogICAgfSkKICApOwp9IGNhdGNoIChlcnJvcikgewogIGNvbnNvbGUubG9nKAogICAgSlNPTi5zdHJpbmdpZnkoewogICAgICBsZXZlbDogImVycm9yIiwKICAgICAgbWVzc2FnZTogIkNyb24gam9iIGZhaWxlZCIsCiAgICAgIGVycm9yOiBlcnJvciBpbnN0YW5jZW9mIEVycm9yID8gZXJyb3IubWVzc2FnZSA6ICJVbmtub3duIGVycm9yIiwKICAgIH0pCiAgKTsKICBwcm9jZXNzLmV4aXQoMSk7Cn0K`

## Documentation

# Deploy and Host Cron Webhook Trigger on Railway

A lightweight Bun function that triggers HTTP endpoints on a schedule using Bearer token authentication. Perfect for running scheduled tasks, triggering webhooks, or pinging external APIs securely without managing infrastructure.

## About Hosting Cron Webhook Trigger

This template deploys a minimal Bun function on Railway that calls a configured endpoint with a `CRON_SECRET` Bearer token for authentication. The function runs on Railway's cron scheduler, which you configure in the Settings tab after deployment. All logs are structured JSON for easy debugging in Railway's log viewer. Simply set your environment variables, configure your cron schedule, and your endpoint will be called automatically at your specified interval.

## Common Use Cases

- Triggering scheduled jobs on external APIs or your own services
- Pinging health check endpoints at regular intervals
- Running periodic data sync or cleanup tasks on remote servers

## Dependencies for Cron Webhook Trigger Hosting

- `CRON_SECRET` - A secure token used in the Authorization Bearer header
- `ENDPOINT_URL` - The URL to call when the cron job runs

### Deployment Dependencies

- [Bun Runtime](https://bun.sh/)
- [Railway Cron](https://docs.railway.com/reference/cron-jobs)

### Implementation Details

After deploying, you must configure the cron schedule in the **Settings** tab of your service. Set the schedule using standard cron syntax (e.g., `0 * * * *` for hourly, `*/15 * * * *` for every 15 minutes).

The function logs all responses as structured JSON:
```json
{
  "level": "info",
  "message": "Cron job completed",
  "status": 200,
  "data": { ... }
}
```

## Why Deploy Cron Webhook Trigger on Railway?

Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.

By deploying Cron Webhook Trigger on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.

## Similar templates

- [N8N Main + Worker](https://railway.com/deploy/n8n-main-worker) — Deploy and Host N8N with Inactive worker.
- [Evolution API with n8n](https://railway.com/deploy/evolution-api-with-n8n) — Automate WhatsApp workflows with Evolution API, n8n, and Postgres.
- [Postgres Backup](https://railway.com/deploy/postgres-s3-backups) — Cron-based PostgreSQL backup to bucket storage

Open this page in a browser: https://railway.com/deploy/cron-webhook-trigger
