Quickstart Guide
Reliable background jobs, simplified. Get CronFlow running in under five minutes.
Begin Setup View Examples1. Installation
Add the CronFlow client to your project using your preferred package manager. The SDK is lightweight, tree-shakeable, and requires zero external dependencies.
For Python, run pip install cronflow-sdk. Node.js users should execute npm install @cronflow/js, while Go developers can fetch it via go get github.com/cronflow/sdk-go. After installation, generate your API key from the dashboard and set it as the CRONFLOW_API_KEY environment variable. Ensure your cluster region matches your deployment target (e.g., us-east-1 or eu-central-1).
2. Code Snippets
Initialize the client and schedule your first task. The following examples demonstrate a recurring "Hello World" job that executes every minute.
Python
import cronflow
client = cronflow.Client(api_key="cf_live_8x92k...")
@client.job(schedule="* * * * *")
def hello_world():
print("CronFlow job executed successfully.")
client.start()
Node.js
const { CronFlow } = require('@cronflow/js');
const client = new CronFlow('cf_live_8x92k...');
client.schedule('hello-world', '* * * * *', async () => {
console.log('CronFlow job executed successfully.');
});
client.start();
Go
package main
import "github.com/cronflow/sdk-go"
func main() {
client := cronflow.New("cf_live_8x92k...")
client.Job("hello-world", "* * * * *", func() {
fmt.Println("CronFlow job executed successfully.")
})
client.Run()
}
3. Verification
Confirm your job is active by checking the execution logs. CronFlow provides immediate feedback through the CLI and web dashboard.
Run cronflow status --env production to view real-time job states. You should see the "hello-world" task listed with a green "Scheduled" indicator and a next run timestamp. If you encounter authentication errors, verify that your CRONFLOW_API_KEY matches the region cluster. Once verified, you can safely commit the configuration to your repository and deploy to your staging environment. For advanced retry policies and webhook routing, consult the API reference.