Loading...
Loading...
Automate recurring operations with cron-based scheduling. Run audits, generate reports, clean up data, and perform compliance checks on autopilot.
DRD provides built-in task types for common compliance operations. Each type has pre-configured defaults and can be customized.
Automated audit of agent compliance against active governance policies. Generates findings, calculates compliance scores, and creates remediation tasks for violations.
Generates compliance reports in PDF or JSON format. Includes executive summaries, control status, trend analysis, and detailed findings. Auto-distributes to stakeholders.
Lightweight policy evaluation sweep across all active agents. Checks policy adherence, evidence freshness, and control status. Faster than full audit.
Full recalculation of trust scores across all agents using the 30-day sliding window. Updates score history, triggers threshold alerts, and refreshes badge eligibility.
Pulls evidence from integrated sources (cloud providers, SIEM, identity providers) and maps to compliance controls. Marks stale evidence for review.
Execute a custom webhook or internal function on a cron schedule. Define your own payload, timeout, and retry policy for specialized automation needs.
DRD uses standard 5-field cron expressions with optional timezone specification. All times default to UTC.
# ┌───────── minute (0-59)
# │ ┌───────── hour (0-23)
# │ │ ┌───────── day of month (1-31)
# │ │ │ ┌───────── month (1-12)
# │ │ │ │ ┌───────── day of week (0-6, Sunday=0)
# │ │ │ │ │
# * * * * *
# Examples:
# */5 * * * * Every 5 minutes
# 0 0 * * * Daily at midnight
# 0 6 * * 1-5 Weekdays at 6 AM
# 0 0 1 * * Monthly on the 1st
# 0 0 1 1,4,7,10 * Quarterly (Jan, Apr, Jul, Oct)Timezone Support
Add a timezone field to any task to schedule in local time. Example: "timezone": "America/New_York". Without a timezone, all schedules run in UTC.
Every task execution is logged with its status, duration, output, and any errors. History is retained for 90 days by default.
| Status | Description | Retry Behavior |
|---|---|---|
| success | Task completed without errors within timeout | None |
| failed | Task threw an error or returned non-zero exit code | Up to 3 retries with exponential backoff |
| timeout | Task exceeded configured timeout (default: 5 min) | Retried once with doubled timeout |
| skipped | Previous execution still running when schedule fires | Skipped, logged as overlap |
| cancelled | Manually cancelled by user or system | None |
Overlap Prevention
By default, DRD skips a scheduled execution if the previous run is still in progress. Set "allowOverlap": true to allow concurrent executions.
curl -X POST https://api.drd.io/v1/tasks/scheduled \
-H "Authorization: Bearer drd_ws_sk_live_Abc123..." \
-H "Content-Type: application/json" \
-d '{
"type": "compliance_audit",
"name": "Weekly Full Audit",
"schedule": "0 0 * * 0",
"timezone": "America/New_York",
"config": {
"scope": "all_agents",
"frameworks": ["gdpr", "soc2"],
"severity": "all",
"createRemediationTasks": true
},
"timeout": 600,
"retries": 3,
"enabled": true
}'
# Response
{
"ok": true,
"data": {
"id": "task_01JM7XBN4RTYP",
"type": "compliance_audit",
"name": "Weekly Full Audit",
"schedule": "0 0 * * 0",
"timezone": "America/New_York",
"nextRun": "2026-02-16T05:00:00Z",
"enabled": true,
"createdAt": "2026-02-14T12:00:00Z"
}
}curl "https://api.drd.io/v1/tasks/scheduled/task_01JM7XBN4RTYP/history?limit=5" \
-H "Authorization: Bearer drd_ws_sk_live_Abc123..."
# Response
{
"ok": true,
"data": [
{
"executionId": "exec_01JM8ABC4RTYP",
"status": "success",
"startedAt": "2026-02-09T05:00:00Z",
"completedAt": "2026-02-09T05:03:42Z",
"durationMs": 222000,
"output": {
"agentsAudited": 12,
"violations": 3,
"remediationTasksCreated": 3
}
}
]
}import { DRDClient } from "@drd-io/sdk";
const drd = new DRDClient({
apiKey: process.env.DRD_API_KEY!,
workspace: process.env.DRD_WORKSPACE!,
});
// Create a daily compliance check
const task = await drd.tasks.scheduled.create({
type: "compliance_check",
name: "Daily Policy Sweep",
schedule: "0 6 * * *",
timezone: "UTC",
config: {
scope: "all_agents",
severity: "high",
},
});
// List all scheduled tasks
const tasks = await drd.tasks.scheduled.list();
for (const t of tasks) {
console.log(`${t.name}: next run ${t.nextRun} [${t.enabled ? "ON" : "OFF"}]`);
}
// Trigger a task manually (outside schedule)
const execution = await drd.tasks.scheduled.trigger(task.id);
console.log(`Triggered: ${execution.executionId}`);
// Check execution history
const history = await drd.tasks.scheduled.history(task.id, { limit: 10 });
for (const h of history) {
console.log(`${h.startedAt}: ${h.status} (${h.durationMs}ms)`);
}