# Scheduled Python without the AWS plumbing

Source: https://clickruntime.com/alternatives/aws-lambda-eventbridge

> Lambda with EventBridge Scheduler is a solid way to run code on a timetable, once you've set up the role, the package, the schedule, the secrets and somewhere to keep state. ClickRuntime does all of that for each automation, and your AI assistant writes the script.

## Why people move small jobs off Lambda

- **Nothing to provision.** No roles, policies, packages or schedule resources. An automation is a script, a schedule or trigger link, and its keys.
- **State built in.** Each automation keeps its own state and counters. No DynamoDB table or S3 object to set up for “what did I see last time”.
- **Built from the assistant you already use.** Ask in ChatGPT, Claude, Cursor or any MCP client. It writes the automation, tests it and fixes it.
- **Keys stay out of code.** Secrets are saved in the ClickRuntime dashboard, read by the script when it runs, and masked in every log.
- **Failures reach you.** Every run is logged with output and errors, and you get an email when one fails. No alarm to configure.
- **Unlimited users.** Plans are per workspace. Invite the whole team at no extra cost.

## AWS Lambda + EventBridge and ClickRuntime compared

|  | AWS Lambda + EventBridge | ClickRuntime |
|---|---|---|
| Setup | Function, IAM role, schedule, schedule role, secrets, logs and alarms | Describe the job in your AI assistant |
| Languages | Python (3.11 and later supported), Node.js, Java, .NET, Ruby, Go and custom runtimes | Python 3.11 |
| Shortest interval | rate(1 minute) in EventBridge Scheduler | Every 5 minutes |
| Timezone | IANA timezones on cron schedules | IANA timezones, in plain words |
| Run length | Up to 900 seconds (15 minutes) | Short jobs: a time limit per run |
| State | Another service, such as DynamoDB or S3 | Built into every automation |
| Webhooks | Function URLs or API Gateway; you write the signature check | Trigger link with signature checks for Stripe, GitHub, Shopify, Typeform and HMAC |
| Cost | Lambda: 1M requests and 400,000 GB-seconds a month free. Scheduler: 14M invocations free, then $1.00 per million | 250 runs a month free; paid plans from $9 for 2,000 runs |
| Team access | IAM users and roles | Unlimited users per workspace |

ClickRuntime pricing: https://clickruntime.com/pricing

## AWS Lambda + EventBridge or ClickRuntime?

### Choose AWS Lambda + EventBridge when

- The job is heavy: more memory, longer runs up to 15 minutes, or high volume where per-request pricing wins.
- It needs to reach things inside your AWS account: a private VPC, RDS, SQS or S3 buckets with IAM permissions.
- Your team already manages infrastructure as code and wants the job alongside the rest.

### Choose ClickRuntime when

- The job calls public APIs and should just run: reports, syncs, alerts, webhook handlers.
- You don't want to own a role, a package and a table for a 40-line script.
- Non-engineers should be able to ask for changes from their AI assistant.

## Move from AWS Lambda + EventBridge

1. **Pick a function.** Start with a scheduled or webhook function that calls public APIs. Copy its code and note its schedule expression and timezone.
2. **Ask your assistant to rebuild it.** Connect ClickRuntime to ChatGPT, Claude or Cursor, paste the handler code and schedule and say what should happen. It saves a draft you can read before anything runs.
3. **Save your keys in the ClickRuntime dashboard.** Secrets from Secrets Manager or environment variables don't move over. Save each API key as a secret in the ClickRuntime dashboard, or sign in through the app's OAuth. Keys never go into the chat.
4. **Test it.** Your assistant turns the automation on, runs it once or sends a test event, and fixes it until the run succeeds. Run both side by side for a few days if you like.
5. **Switch the old one off.** Disable the EventBridge schedule (or remove the function URL from the sender), then delete the function, role and table when you're sure.

## One job, moved from AWS Lambda + EventBridge

Before: lambda_function.py + EventBridge schedule

```python
# Schedule: cron(0 8 ? * MON-FRI *), timezone Europe/London, target: this function
import os, json, boto3, urllib.request

table = boto3.resource("dynamodb").Table("job-state")

def lambda_handler(event, context):
    key = boto3.client("secretsmanager").get_secret_value(SecretId="yourapp-api-key")["SecretString"]
    req = urllib.request.Request("https://api.yourapp.com/v1/signups?since=24h", headers={"Authorization": f"Bearer {key}"})
    rows = json.load(urllib.request.urlopen(req))["data"]
    prev = table.get_item(Key={"id": "signups"}).get("Item", {}).get("count")
    table.put_item(Item={"id": "signups", "count": len(rows)})
    # ...post to Slack with a webhook URL from another secret
    return {"signups": len(rows), "previous": prev}
```

After, the prompt: "Move this Lambda to ClickRuntime: every weekday at 8:00 London time, count signups from our API in the last 24 hours and post the number to #metrics in Slack, with the change from the day before."

The ClickRuntime script:

```python
from clickruntime import on_trigger, credentials, http, notify, state

API = "https://api.yourapp.com/v1/signups"

@on_trigger
def run(event):
    key = credentials.secret("YOURAPP_API_KEY")
    rows = http.get(API, params={"since": "24h"}, headers={"Authorization": f"Bearer {key}"}).json()["data"]
    yesterday = state.get("count")
    state.set("count", len(rows))
    change = "" if yesterday is None else f" ({len(rows) - yesterday:+d} on the day before)"
    notify.slack(f"Signups in the last 24 hours: {len(rows)}{change}", channel="#metrics")
    return {"signups": len(rows)}
```

## Where each AWS Lambda + EventBridge piece goes

| In AWS Lambda + EventBridge | In ClickRuntime |
|---|---|
| lambda_handler(event, context) | A function with the @on_trigger or @on_event decorator |
| EventBridge Scheduler schedule | A schedule in plain words, in your timezone |
| Function URL or API Gateway route | Trigger link, with signature checks |
| Secrets Manager / environment variables | Secrets saved in the ClickRuntime dashboard |
| DynamoDB or S3 for state | state.get and state.set |
| Deployment package or layer | Up to 15 pinned PyPI packages declared with the script |
| CloudWatch logs and alarms | Run log, plus an email when a run fails |

## Extend it: what you can add next

Once the first job is moved, these are the changes people usually ask for next. Each is one message to your assistant, not a new service to set up.

- **Handle Stripe refunds on a trigger link with the signature checked for you** (Trigger links)
  Prompt: "Add a trigger link automation that Stripe calls on charge.refunded, checks the signature and posts the amount and reason to #finance."
- **Keep a 30-day history of counts without a database** (Memory between runs)
  Prompt: "Change my signups report so it keeps the last 30 daily counts and includes the 7-day average."
- **Summarise yesterday's signup sources in one line** (Built-in AI)
  Prompt: "Change my signups report so it adds one line on where yesterday's signups came from, based on the referrer field."
- **Add new signups to HubSpot as contacts** (Any app or API)
  Prompt: "Add to my signups report: create a HubSpot contact for each new signup that isn't there yet."
- **Skip weekends and holidays from the comparison** (Multi-step logic)
  Prompt: "Change my signups report so Monday compares with Friday, not Sunday."
- **Run a month-end summary on the 1st** (Schedules)
  Prompt: "Add to my signups report: on the 1st of each month at 9, email me last month's total and the best week."

## Moving from AWS Lambda + EventBridge

### Is ClickRuntime serverless like Lambda?

Yes. Scripts run on AWS Lambda behind the scenes, but ClickRuntime sets up and manages everything around them: schedule, trigger link, secrets, state, logs and alerts.

### Can I use Python packages?

Yes. Common ones such as requests, the Google and Slack clients, feedparser and BeautifulSoup are available, and an automation can declare up to 15 pinned PyPI packages.

### Can it reach my VPC or RDS database?

No. Scripts make outbound HTTPS calls to public addresses only. Keep jobs that need private AWS resources on Lambda.

### How long can a run take?

ClickRuntime is for short jobs with a time limit per run. If a job needs close to 15 minutes, Lambda is the better fit.

### Do I need to know how to code?

No. You describe what should happen and your AI assistant writes, tests and fixes the Python. You can read every version in the ClickRuntime dashboard.

### What does ClickRuntime cost?

The free plan includes 250 runs a month with webhooks, code and AI. Paid plans start at $9 a month for 2,000 runs, with unlimited users. A scheduled check that finds nothing new and sends nothing isn't counted.

### Will you help me move my functions?

Yes. Email hello@clickruntime.com with what each functions does, or the Lambda code or config, and we'll help until it's running. Never send API keys or other secrets.
