Agent Jobs
OdapX opened this issue · comments
yahya benzha commented
Goal
Possibility to define scheduled jobs
Example:
- Generate 10 tweets every day
- Generate draft email for churn customers
- Update dev dependencies every friday and tag responsible.
model Worfklow {
id String @id @default(cuid())
name String
query String?
agent Agent? @relation(fields: [agentId], references: [id], onDelete: Cascade)
agentId String? @map("agent_id")
interval WorkflowInterval
runs Job[]
createdAt DateTime @default(now()) @map("created_at")
updatedAt DateTime @default(now()) @updatedAt @map("updated_at")
@@map("jobs")
}
model Job {
id String @id @default(cuid())
workflow Workflow? @relation(fields: [workflowId], references: [id], onDelete: Cascade)
workflowId String? @map("workflow_id")
conversation Conversation? @relation(fields: [conversationId], references: [id], onDelete: Cascade)
conversationId String? @map("conversation_id")
status JobStatus @default(QUEUED)
createdAt DateTime @default(now()) @map("created_at")
updatedAt DateTime @default(now()) @updatedAt @map("updated_at")
@@map("jobs")
}
enum WorkflowInterval {
HOURLY
WEEKLY
DAILY
}
enum JobStatus {
QUEUED
PENDING
DONE
ERROR
}
Georges Petrov commented
yahya benzha commented