Skip to main content
Cron schedules trigger your deployed applications on a recurring basis with no external schedulers, IAM policies, or queue infrastructure required. You can manage schedules programmatically via the API or through the Applications UI.

Prerequisites

  • A deployed Tensorlake application. See the Quickstart to deploy one.
  • Your namespace and application name.

Creating a Schedule

Send a POST request to create a cron schedule for a deployed application. The schedule starts immediately after creation.
POST /v1/namespaces/{namespace}/applications/{application}/cron-schedules
import requests, base64, json

namespace = "my-namespace"
application = "my-app"

payload = {"cron_expression": "0 * * * *"}  # Every hour

# Optional: pass input data to each invocation
input_data = json.dumps({"report_type": "daily"}).encode()
payload["input_base64"] = base64.b64encode(input_data).decode()

response = requests.post(
    f"https://api.tensorlake.ai/v1/namespaces/{namespace}/applications/{application}/cron-schedules",
    json=payload,
    headers={"Authorization": "Bearer TENSORLAKE_API_KEY"},
)
response.raise_for_status()

schedule_id = response.json()["schedule_id"]
print(f"Created schedule: {schedule_id}")

Request fields

FieldTypeRequiredDescription
cron_expressionstringYesA valid 5-field cron expression
input_base64stringNoBase64-encoded bytes passed as input on every invocation. Maximum 1 MiB decoded.
The response returns a schedule_id. Save this — it is required to delete the schedule later.
The minimum allowed interval is 60 seconds. * * * * * (every minute) is the fastest supported expression. Sub-minute expressions are rejected with a 400 error.

Listing Schedules

Retrieve all cron schedules for an application:
GET /v1/namespaces/{namespace}/applications/{application}/cron-schedules
response = requests.get(
    f"https://api.tensorlake.ai/v1/namespaces/{namespace}/applications/{application}/cron-schedules",
    headers={"Authorization": "Bearer TENSORLAKE_API_KEY"},
)
response.raise_for_status()

for schedule in response.json()["schedules"]:
    print(schedule["id"], schedule["cron_expression"], schedule["next_fire_time_ms"])

Response fields

FieldTypeDescription
idstringUnique ID for this schedule
application_namestringThe application this schedule belongs to
cron_expressionstringThe schedule expression as stored
next_fire_time_msnumberUnix timestamp (ms) of the next scheduled invocation
last_fired_at_msnumber | nullUnix timestamp (ms) of the last invocation. null if the schedule has never fired.
created_atnumberMonotonic counter for ordering — not a wall-clock timestamp, do not display as a date
enabledbooleanAlways true — reserved for future use
next_fire_time_ms and last_fired_at_ms are standard Unix millisecond timestamps. In JavaScript: new Date(next_fire_time_ms).

Deleting a Schedule

DELETE /v1/namespaces/{namespace}/applications/{application}/cron-schedules/{schedule_id}
response = requests.delete(
    f"https://api.tensorlake.ai/v1/namespaces/{namespace}/applications/{application}/cron-schedules/{schedule_id}",
    headers={"Authorization": "Bearer TENSORLAKE_API_KEY"},
)
response.raise_for_status()
Deletion is permanent. To modify a schedule, delete it and recreate it — you can reuse the cron_expression from the list response to pre-populate the new request.

Limits

LimitValue
Minimum interval60 seconds
Maximum schedules per application100
Maximum input payload1 MiB (decoded)

Durable Execution

How Tensorlake recovers scheduled runs from the last successful checkpoint on failure.

Observability

Monitor scheduled invocations alongside the rest of your application activity.

Retries

Configure automatic retries for functions triggered by the scheduler.

Secrets

Pass secrets securely to functions that run on a schedule.