from polos import PolosClient, schedules
client = PolosClient(project_id="your-project-id")
# Create a schedule for a specific user
schedule_id = await schedules.create(
client=client,
workflow="reminder",
cron="0 8 * * *",
timezone="America/New_York",
key="user-alice", # Unique key for this schedule
)
# Create different schedules for different users
users = [
{"id": "user-alice", "cron": "0 8 * * *", "tz": "America/New_York"},
{"id": "user-bob", "cron": "0 9 * * *", "tz": "Europe/London"},
]
for user in users:
await schedules.create(
client=client,
workflow="reminder",
cron=user["cron"],
timezone=user["tz"],
key=user["id"],
)