← Back to blog

Published on

How do you run daily scripts in the cloud and pay only for the minutes?

Use a scheduled job service: you set the schedule with a cron expression, the platform starts the script, it exits, and you pay only for the time it ran. On Zenifra, a 2-minute daily script on the job-basic plan costs R$ 0.05 (R$ 0.049999998 exact) per month, in reais and with no IOF tax; this guide compares the same script on GitHub Actions, Cloudflare Workers, Google Cloud Run Jobs, AWS Lambda, Render, and Railway, using official sources read on November 6, 2026.

The short answer: what changes when you pay by the minute

To run a script every day without keeping a server on, use a scheduled job: the platform reads a cron expression, starts your code on time, waits for it to exit, and charges only for the execution time. On Zenifra this is called a Scheduled Job, it is billed per minute in Brazilian reais, and it can start from a Docker image or from a GitHub repository.

The cost difference compared with an always-on application is large when the work is short. A 2-minute daily script runs 60 minutes a month. On Zenifra’s job-basic plan (0.5 vCPU and 512 MB), each minute costs R$ 0.0008333333, so the whole month comes to R$ 0.05. An application on the Basic plan, with the same 0.5 vCPU and 512 MB, costs R$ 29.90 per month on the monthly contract because it stays on 24 hours a day waiting for the next run.

Per-minute billing is not unique to Zenifra. GitHub Actions, Cloudflare Workers, Google Cloud Run, AWS Lambda, Render, and Railway also bill by usage, and some have free tiers that bring small scripts down to zero. What changes between them is the currency, the maximum duration of each run, the shortest interval between runs, and the kind of code they accept. The sections below show those limits and the math for three scenarios on each platform, so you can choose with numbers instead of impressions.

All dollar prices were read on the official pages on November 6, 2026 and converted at the PTAX selling rate of November 5, 2026 (R$ 5.4621), plus the 3.5% IOF tax on international card purchases (Decree 6,306/2007, art. 15-B, item VII, as amended by Decree 12,499/2025). Zenifra prices come from the public Scheduled Job plan catalog, checked on the same day.

Which tasks make sense as a scheduled job

The test is simple: the task starts, does a finite piece of work, and exits. If it needs to keep listening for requests or for a queue all the time, it is an application or a continuous worker, not a job. If it runs at known times and exits with an exit code, it is a job, and paying by the minute is usually the cheapest way to host it.

The most common cases in small teams are listed below. In all of them the pattern is the same: read configuration from environment variables, do the work, record the result in the logs, and exit with code 0 when it worked or with another code when it failed, so the platform marks the run as failed and alerts you.

  • Logical backup: export the database with pg_dump or mysqldump and send the file to S3-compatible object storage, such as Zenifra’s Armazém, every night.
  • Report: query the database, build a CSV or PDF with the previous day’s sales, and send it by email or to a shared folder.
  • Sync: fetch orders, stock, or customer records from an external API every hour and update your database.
  • Data collection (scraping): visit public pages at fixed times, extract prices or status, and keep the history, respecting each site’s terms of use and robots.txt.
  • Batch email: due-date reminders, weekly digests, or inactivity notices sent at a set time.
  • Maintenance: delete old sessions and temporary files, rebuild caches, generate sitemaps, or call an internal route in your application that runs a routine.

Tasks that need to run for more than 60 minutes in one go, or that must react within seconds to an event, call for a different design: split the work into smaller parts, use a queue with a worker, or pick a platform with a longer duration limit. Those trade-offs show up in the comparison further down.

How Zenifra Scheduled Jobs work

A Scheduled Job is a project type on Zenifra. You choose the task source (a Docker image or a GitHub repository), write a five-field cron expression, and Zenifra starts the task at each scheduled time. The schedule is always interpreted in UTC, and the Console shows the next run times right below the expression so you can check them before creating the job. There is no time zone option: for midnight in Brasília (UTC−3), use 03:00 UTC.

The execution rules are spelled out in the documentation. Each job runs at most one execution at a time: if the next scheduled time arrives while the previous run is still going, that time is skipped, not queued. A run that does not finish within 60 minutes is stopped as Time limit exceeded. There is no automatic retry: if it fails, the next run happens at the next scheduled time. Exit code 0 means Succeeded; any other code means Failed.

Each run is recorded in the Runs card on the project page, with the scheduled time, status, duration, and billed minutes. View logs shows what the task wrote, even after it finishes, fails, or is cancelled; Zenifra keeps the last 50 KB of logs for each run. On the job-premium plan, View metrics shows CPU and memory for each run. Every job is created with email alerts on: the organization owner gets a notice when a run fails, runs out of the plan’s memory, or goes past 60 minutes, with at most one email per hour while failures continue.

With a GitHub source, Zenifra builds the code with the chosen runtime (Node.js, Python, Bun, Go, Java, or PHP) and uses the result for every run. Build time is not billed, and a new build applies to the next runs without interrupting the one in progress. In the Console, the Docker image must be public and the image’s own default command is used; private images and custom command or arguments are available through the API.

PlanvCPUMemoryEphemeral storagePrice per minute60 minutes of executionPer-run metrics
job-starter0.1128 MB1 GBR$ 0.0001666666R$ 0.009999996No
job-basic0.5512 MB5 GBR$ 0.0008333333R$ 0.049999998No
job-premium11 GB5 GBR$ 0.0018333333R$ 0.109999998Yes

The catalog publishes prices in Brazilian centavos (0.01666666, 0.08333333, and 0.18333333 centavos per minute); the table shows the same values in reais, without rounding. All three plans allow up to 60 minutes per run, UTC scheduling, logs for every run, and optional persistent storage, billed separately per GB-hour. The plan guide recommends job-starter for short calls and shell scripts, job-basic for Node.js or Python scripts with dependencies and database access, and job-premium for reports, exports, and logical backups.

How minutes turn into the amount on your bill

Billing uses the task’s actual start and end. Preparation time, such as downloading the image, is not counted, and a run that never started is not billed. Duration is rounded up to the next full minute, with a minimum of 1 minute and a maximum of 60, and the amount for each run is stored exactly, without rounding up: a run that costs R$ 0.0005 is billed as R$ 0.0005.

Runs that failed, were cancelled after starting, or timed out are billed for the time actually used. When you cancel a run in the Console, Zenifra gives the task up to 30 seconds to shut down gracefully, and those shutdown seconds are not billed: the charge stops at the moment you confirmed the cancellation.

When the cycle closes, the total of all runs is deducted first from the organization’s balance; whatever is left is charged to the card in whole centavos, and the leftover fraction of a centavo carries over to the next cycle. That is why a job that costs R$ 0.05 a month does not turn into a rounded R$ 0.05 charge every cycle. The organization can pay by PIX, boleto, or card, always in reais, so there is no currency conversion and no IOF.

Actual run durationBilled minutesAmount on job-basic
1 second1R$ 0.0008333333
59 seconds1R$ 0.0008333333
70 seconds2R$ 0.0016666666
60 minutes60R$ 0.05

The Current cycle cost card adds up the amounts of the runs completed in the cycle, along with the number of runs and minutes. On the billing date, the run list, cost, logs, and metrics shown start again from zero; the records are kept internally for up to 90 days. Each run’s ephemeral storage has no extra charge but is erased at the end; only persistent storage, when enabled, is billed per GB-hour while the project exists, even when paused.

GitHub Actions, Cloudflare, Cloud Run, Lambda, Render, and Railway: the limits of each

Before price, look at what each service accepts, because a duration or memory limit rules out an option before any math. The table summarizes the official pricing and limits pages read on November 6, 2026. Values are in US dollars; the conversion to reais is in the next section.

GitHub Actions and Render run a regular process, such as a Python or Node.js script, and accept container images. Cloud Run Jobs runs a container image. AWS Lambda runs a function on a managed runtime or from an image, with 128 MB to 10,240 MB of memory and CPU proportional to memory. Cloudflare Workers runs code on the Workers runtime, with 128 MB of memory per isolate, and mainly bills CPU time, not wall-clock time.

ServiceHow it billsUsage included at no costMaximum duration per runScheduling
GitHub Actions (2-core Linux runner)US$ 0.006 per minute in private repositories, with each job rounded up to the whole minutePublic repositories do not pay for standard runners; the Free plan includes US$ 12 of usage per month (2,000 Linux minutes)6 hours per jobPOSIX cron in UTC, with an optional IANA time zone; 5-minute minimum interval; can be delayed at peak times, and queued jobs may be dropped
Cloudflare Workers with Cron TriggersPaid plan with a US$ 5 monthly minimum; above the included usage, US$ 0.02 per million CPU ms and US$ 0.30 per million requestsPaid: 10 million requests and 30 million CPU ms per month; Free: 5 Cron Triggers and 10 ms of CPU per invocation15 minutes of CPU for intervals of 1 hour or more; 30 seconds for shorter intervalsUp to 250 Cron Triggers per account on Paid
Google Cloud Run Jobs with Cloud SchedulerUS$ 0.000018 per vCPU-second and US$ 0.000002 per GiB-second (us-central1), in 100 ms increments; Scheduler at US$ 0.10 per job every 31 days240,000 vCPU-seconds and 450,000 GiB-seconds per month per billing account; 3 Scheduler jobs per account10 minutes by default, configurable up to 168 hoursThe schedule lives in Cloud Scheduler, billed per job
AWS Lambda with EventBridge SchedulerUS$ 0.0000166667 per GB-second and US$ 0.20 per million requests; Scheduler at US$ 1.00 per million invocations1 million requests and 400,000 GB-seconds per month; 14 million Scheduler invocations15 minutes (900 seconds)The schedule lives in EventBridge Scheduler
Render Cron Jobs (0.5c-512mb)US$ 0.00016 per minute, prorated by the second; US$ 1 monthly minimum per cron jobNo free usage for cron jobs12 hoursCron in UTC; at most one active run at a time
Railway (service with a cron schedule)By usage: US$ 0.000463 per vCPU-minute and US$ 0.000231 per GB-minute of RAM; Hobby US$ 5 per month, which becomes usage creditFree plan with US$ 1 of credit per monthDoes not stop the run on its own; if the previous run is still active, the next one is skippedCron in UTC, with at least 5 minutes between runs
Zenifra Scheduled Jobs (job-basic)R$ 0.0008333333 per minute, rounded up to the whole minute, in reaisNo free usage; only the minutes run are billed60 minutesFive-field cron in UTC; one run at a time; no automatic retry

Two details weigh on the choice. For GitHub Actions, the documentation itself warns that the schedule event can be delayed during periods of high load, especially at the start of every hour, and that some queued jobs may be dropped; in public repositories, scheduled workflows are disabled after 60 days without activity. On the other hand, GitHub accepts an IANA time zone in the schedule, which Zenifra, Render, and Railway do not offer.

The Cloud Run prices used here are for us-central1 (Iowa), the reference region of the table; the page shows that other regions, such as São Paulo (southamerica-east1), have their own price tier. For Lambda, the price per GB-second is the one in the pricing page example; other regions also have different prices.

What each scenario costs on each platform

All three scenarios use a 30-day month. Scenario A: a 2-minute script once a day (30 runs, 60 minutes a month). Scenario B: a 15-minute script every hour (720 runs, 10,800 minutes). Scenario C: a 1-hour script once a day (30 runs, 1,800 minutes). To compare similar resources, we used 0.5 vCPU and 512 MB wherever the service lets you choose, 1 vCPU and 512 MiB on Cloud Run, and 512 MB on Lambda. On Cloudflare we assumed the worst case: the script uses CPU the entire time.

Values in reais use the PTAX rate of November 5, 2026 (R$ 5.4621) and 3.5% IOF. When the free tier covers a scenario, the cost shows as zero, but keep in mind that free tiers are per account and shared with everything else you already run there.

Platform and configurationA: 2 min per dayB: 15 min per hourC: 1 h per day
Zenifra job-basic (0.5 vCPU, 512 MB)R$ 0.05R$ 8.99999964R$ 1.50 (R$ 1.49999994 exact), as two 30-minute runs
Zenifra job-starter (0.1 vCPU, 128 MB)R$ 0.009999996R$ 1.79999928R$ 0.30 (R$ 0.29999988 exact), as two 30-minute runs
GitHub Actions, private repository, Free planUS$ 0 (US$ 0.36 within the included US$ 12)US$ 52.80 beyond the included usage = R$ 298.49US$ 0 (US$ 10.80 within the included US$ 12)
Cloudflare Workers Paid, CPU busy the whole timeUS$ 5.00 = R$ 28.27US$ 17.36 = R$ 98.14Does not fit: 15-minute maximum per run
Cloud Run Jobs, 1 vCPU and 512 MiB, us-central1US$ 0 (free tier)US$ 7.34 = R$ 41.52US$ 0 (free tier)
AWS Lambda, 512 MB, with EventBridge SchedulerUS$ 0 (free tier)US$ 0 within the free tier; US$ 5.40 = R$ 30.53 without itDoes not fit: 15-minute maximum per invocation
Render Cron Job 0.5c-512mbUS$ 1.00 (minimum) = R$ 5.65US$ 1.73 = R$ 9.77US$ 1.00 (minimum) = R$ 5.65
Railway Hobby, 0.5 vCPU and 0.5 GB in useUS$ 5.00 subscription (US$ 0.02 of usage) = R$ 28.27US$ 5.00 subscription (US$ 3.75 of usage) = R$ 28.27US$ 5.00 subscription (US$ 0.62 of usage) = R$ 28.27

An honest reading of the table: if the script already lives in a public repository, GitHub Actions runs every scenario at no cost, as long as you accept schedule delays. If you already have an AWS or Google Cloud account with an unused free tier, scenarios A and C cost zero on Cloud Run, and A also costs zero on Lambda. Render is cheap for heavy-usage scenarios but charges the US$ 1 minimum per cron job; Railway makes sense when the US$ 5 subscription already pays for your other services.

On Zenifra, all three scenarios stay under R$ 9 per month on job-basic and under R$ 2 on job-starter, with no free tier to keep track of, no international card, and no exchange-rate swings. Scenario B is where the difference shows: 10,800 minutes cost R$ 9.00 (R$ 8.99999964 exact) on job-basic, against R$ 41.52 on Cloud Run after the free tier and R$ 298.49 on private GitHub Actions.

Scenario C shows Zenifra’s limit. A run lasts at most 60 minutes, so a script that takes 1 hour sits right at the limit and can be stopped as Time limit exceeded. The safe path is to split the work into two 30-minute runs, at the same total cost; if the task needs several hours in a row, Cloud Run Jobs (up to 168 hours), Render (12 hours), or GitHub Actions (6 hours) are a better fit.

Step by step: create a job in the Console or with the CLI

The flow below follows the Scheduled Jobs documentation. Before you start, have the full reference of a public Docker image, with registry and tag or digest (for example, docker.io/library/alpine:3.20), or a GitHub repository with the command that runs the task. In both cases the task must exit on its own: a web server image, which keeps waiting for requests, always ends as Time limit exceeded.

  • 1. In the Console menu, click Create project and choose Scheduled Job.
  • 2. Choose the plan. Each plan shows vCPU, memory, storage, and the price per minute.
  • 3. Under Basic Information, name the project.
  • 4. Under Configure Scheduled Job, choose the Task source: OCI Image (enter the Task image) or GitHub Repository (choose the repository, Branch, Runtime, Version, Root directory, and Task command).
  • 5. Fill in the Cron expression, in UTC, and check the Next execution times (UTC) that the Console shows right below it.
  • 6. Set the Task storage. If the task needs to keep files from one run to the next, turn on Keep data between runs and enter the Persistent directory, for example /data.
  • 7. Under Environment Variables, add the keys, addresses, and passwords the task uses.
  • 8. Review the Cost Summary and click Create Job.
bash
zenifra plans --type jobs
zenifra create project --name nightly-report --plan job-basic --payment-mode per_minute --config @examples/job-project.json
zenifra project runs --project <project-id>
zenifra project runs logs --project <project-id> --run <run-id>

The Console does not ask for a port, domain, or instances, because a job runs, exits, and waits for the next scheduled time. With a GitHub source, the first build happens at creation and the job starts running on schedule after it finishes; the Deployment mode decides whether later builds are manual, on every push to the branch, by tag, or by release.

With the CLI, list the plans with zenifra plans --type jobs and create the job from a configuration file: zenifra create project --name nightly-report --plan job-basic --payment-mode per_minute --config @examples/job-project.json. Then follow the runs with zenifra project runs --project <project-id>, read a run’s logs with zenifra project runs logs --project <project-id> --run <run-id>, and cancel with zenifra project runs cancel. The CLI only accepts an image source; for GitHub, private images, or a custom command, use the Scheduled Jobs API.

Example: a daily Python script and cron expressions in UTC

Zenifra’s public examples repository has ready-made jobs in Node.js, Bun, and Python. The Python example is an uptime checker that uses only the standard library: it reads URLs from an environment variable, makes the requests with a timeout and retries, keeps state between runs in the persistent directory, and sets the exit code based on the result. It also handles the termination signal, so it shuts down cleanly when a run is cancelled or paused.

To publish it, create a job with a GitHub Repository source and fill in the fields as in the example’s README. Running it locally first is the cheapest test there is: with TARGET_URLS=https://example.com python -m uptime_job you see the same logs you will later read in View logs.

  • Root directory: python (or . if the folder is the repository root)
  • Runtime: Python, version 3.11 or newer
  • Task command: python -m uptime_job
  • Environment variable: TARGET_URLS with the URLs to check
When to runBrasília timeCron expression (UTC)
Every day at midnight00:000 3 * * *
Every day at 6 a.m.06:000 9 * * *
Monday to Friday at 9:30 a.m.09:3030 12 * * 1-5
Every 15 minutesAny time*/15 * * * *
On the 1st of every month at 3 a.m.03:000 6 1 * *

The expression accepts values, *, comma lists, hyphen ranges, slash steps, English month and weekday names (jan, mon), and ? in the day-of-month or day-of-week field. Day of week goes from 0 (Sunday) to 6; 7, L, W, #, and H are not accepted. With a GitHub Repository source, Zenifra runs the Task command directly so the process receives the termination notice; commands with | or || do not receive it, so prefer calling a script.

Good practices for reliable jobs

Idempotency comes first. Since Zenifra does not retry a failed run and skips scheduled times while the previous run is still going, the script must produce the same result if it runs twice on the same data, and it must be able to catch up on what was left behind. In practice: store a marker for the last processed item (in the database or in the persistent directory), use unique keys so the same record is never inserted twice, and name backup files by date so a second run replaces the file instead of duplicating it.

Set a timeout on everything that leaves the machine. An HTTP call with no timeout can hold the run until the 60-minute mark and end as Time limit exceeded, billing the whole hour. Use short timeouts for requests and for the database, and do a few retries inside the script itself, with increasing waits between them, only for temporary errors such as 429, 503, or a dropped connection. Permanent errors, such as an invalid credential, should exit with a non-zero code to trigger the email alert.

Secrets belong in environment variables, never in the code or in the image. Database passwords, API keys, and tokens go into Environment Variables in the Console; a change applies from the next run on, with no rebuild. Give each key only the permission it needs: the documentation example that pauses a team’s projects uses an API key with View project and Stop project, and nothing else.

Write short, useful logs. Zenifra keeps the last 50 KB of each run, so log the start, how much was processed, errors with context, and the end, instead of printing every data row. Start on the smallest plan where the task finishes without running out of memory and watch: logs that stop suddenly with no message point to a memory shortage; a long, CPU-bound run may finish in fewer minutes, and cost less, on a larger plan.

When should you use a continuous worker instead of a scheduled job?

Use a continuous worker when the task must react to events at any moment, such as processing a queue as soon as a message arrives, and use a scheduled job when the work happens at known times. Zenifra’s plan guide puts it plainly: a worker that must keep listening to a queue all the time should be an HTTP project or use Queues.

The math helps you decide. The job-basic price per minute, R$ 0.0008333333, equals R$ 0.049999998 per hour of execution, practically the same hourly price as the Basic application plan (R$ 0.05 per hour, with 0.5 vCPU and 512 MB). As long as the script runs only a fraction of the day, the job is cheaper because it does not pay for idle hours. If it would end up running almost all day, a worker on the Basic plan with a monthly contract (R$ 29.90) or on Static (R$ 5.90, with 0.1 vCPU and 128 MB) is more predictable.

Where can you host a Python worker with hourly billing in Brazil?

On Zenifra, a Python worker runs as a private HTTP project, with no public route, billed by the hour in reais: from R$ 0.05 per hour on the Basic plan (0.5 vCPU, 512 MB), according to the public catalog; Static is for static sites. With hourly billing, the project’s total hours in the cycle are rounded up to the full hour, and a paused project does not pay for compute.

The documentation has a complete example: a worker that consumes messages from a managed Valkey Queue with BLPOP, published from a Git repository with the Python 3.13 runtime, Start Command python worker.py, Exposure Private - no public route, and the VALKEY_URL variable with the queue connection. For messages that must not be lost if the worker stops halfway, the documentation itself recommends Streams with consumer groups.

How much does Zenifra’s cheapest Scheduled Job cost?

job-starter, with 0.1 vCPU and 128 MB, costs R$ 0.0001666666 per minute of execution, and only the minutes run are billed; there is no monthly fee and no included free usage.

In practice, the entry cost is small: the 60 minutes that scenario A uses on job-starter in a whole month cost R$ 0.009999996, less than one centavo. Sign-up requires a Brazilian CPF or CNPJ, a mobile number, and an address in Brazil, and payment can be made by PIX, boleto, or card, in reais.

Can I use Brasília time in the cron expression?

Not directly: on Zenifra the cron expression is always interpreted in UTC, so you convert the time. Brasília is UTC−3, so midnight in Brasília is 03:00 UTC (0 3 * * *) and 6 p.m. in Brasília is 21:00 UTC (0 21 * * *).

The Console shows the Next execution times in UTC before you create the job, which prevents conversion mistakes. Render and Railway also use UTC. GitHub Actions is the exception among the services compared: it accepts an optional IANA time zone in the schedule.

What happens if the script fails or runs past 60 minutes?

The run shows as Failed (non-zero exit code) or Time limit exceeded (more than 60 minutes), is billed for the time used, and is not retried: the next run happens at the next scheduled time. The organization owner gets an alert email, at most one per hour while failures continue.

If the failure was memory, the run list shows Out of memory: the run reached the memory limit of the plan. Open View logs to find the error message; if the task often gets close to 60 minutes, split the work into smaller parts or use a larger plan, which may finish the same task in fewer minutes.

See Scheduled Job prices per minute

We respect your privacy

We use essential cookies to run this site. Measurement and marketing cookies, such as Google Ads, are only enabled when you accept all cookies. Read our cookie policy.