Quickstart Guide
Get your first Python background job running on a schedule in under 5 minutes. No local setup or CLI required.
Step 1: Create a Job
Log in to your LiteLambda dashboard and click the New Cron Job button. Give your job a descriptive name, like "Daily API Scraper".
Step 2: Write the Code
In the built-in code editor, write the Python logic you want to execute. Every script must contain a handler function. Here is an example that fetches data from an API and logs the result:
import requests
def handler(event, context):
print("Starting background job...")
# Make an HTTP request
response = requests.get("https://api.github.com/zen")
if response.status_code == 200:
quote = response.text
print(f"Daily Zen: {quote}")
return {"status": "success", "quote": quote}
else:
raise Exception(f"API failed with status {response.status_code}")
Step 3: Define Dependencies
If your script uses external libraries (like requests in the example above), list them in the Pip Packages tab. Enter one package name per line, exactly as you would in a requirements.txt file.
requests==2.31.0
pandas
Step 4: Set the Schedule
Enter a cron expression to dictate when the job should run. LiteLambda uses standard 5-field UTC cron syntax. For example, to run every day at 9:00 AM UTC:
0 9 * * *
Step 5: Test and Activate
Before waiting for the schedule, click Trigger Manually to run the script immediately. Check the Logs tab to ensure there are no syntax errors and that your pip packages installed correctly.
If everything looks good, ensure the toggle is set to Active. Your Python script is now running on autopilot!