Guides
Postmortem Workflow
After resolving an incident, create knowledge to prevent recurrence:
wt create "Database failover caused 5min outage" \
--body "Primary database failed, replica promotion took 5 minutes. Configure automatic failover with 30s timeout, add health check endpoint, and set up PgBouncer connection pooling. Root cause: manual failover process, no health checks on replica." \
--scope globalThought Chaining
When an incident is related to a previous one, link them with --branch-from or prev_knowledge_id:
# First incident
wt create "Redis cluster split-brain" \
--body "Split-brain detected in Redis cluster..." \
--scope global --json
# Returns: { "id": "550e8400-e29b-41d4-a716-446655440000" }
# Follow-up incident (3 months later)
wt create "Redis cluster split-brain (recurrence)" \
--body "Same split-brain issue, different trigger. Added Sentinel quorum validation." \
--scope globalChaining creates a timeline:
550e8400-... : Redis split-brain (initial)
└─ 660f9500-... : Redis split-brain (recurrence)
└─ 770a0600-... : Redis split-brain (final fix)Automated Postmortem Template
Integrate with your incident management tool via the REST API:
async function createPostmortem(incident: Incident) {
const res = await fetch('https://workthin.app/api/v1/knowledge', {
method: 'POST',
headers: {
'Authorization': 'Bearer ' + process.env.WORKTHIN_API_KEY,
'Content-Type': 'application/json',
},
body: JSON.stringify({
title: `[${incident.severity}] ${incident.title}`,
body: `${incident.description}\n\nResolution: ${incident.resolution}\n\nRoot cause: ${incident.rootCause}`,
tags: ['incident', incident.severity, ...incident.services],
scope: 'global',
}),
})
const data = await res.json()
return data.id
}