Task status tracking (Redis events + optional S3 history)
This document describes how Alakai tracks automation tasks.
What is tracked
For each tracked execution, Alakai emits lifecycle events with:
taskNamestatus(in_progress,success,error)project(owner/repo)actor(creator/provider reference, Slack or GitHub)prLinks(created PR URLs when available)visibility.responsibleUsers(fromconfig.json)executionId,eventId,occurredAt,flow
Runtime topology
Task tracking runtime is always active. src/main.ts wires:
- Publisher (
RedisTaskTrackingService)
App routes emit task lifecycle events into a Redis Stream. - Projector worker (
RedisTaskStatusProjector)
Reads stream events and stores latest status by execution in Redis. - Archiver worker (
S3TaskHistoryArchiver, optional)
When enabled by env, reads stream events and writes immutable JSONL batches to S3.
Workers run in-process with the HTTP service and are started/stopped with server lifecycle.
Configuration
Required
TASK_TRACKING_REDIS_URL
Optional (with defaults)
TASK_TRACKING_REDIS_STREAM_KEY(task-events:v1)TASK_TRACKING_REDIS_PROJECTOR_CONSUMER_GROUP(task-status-projector)TASK_TRACKING_REDIS_ARCHIVER_CONSUMER_GROUP(task-history-archiver)TASK_TRACKING_REDIS_CONSUMER_NAME(alakai)TASK_TRACKING_S3_ARCHIVE_ENABLED(false)TASK_TRACKING_S3_BUCKET(required whenTASK_TRACKING_S3_ARCHIVE_ENABLED=true)TASK_TRACKING_S3_PREFIX(task-tracking)
Additional prerequisite:
- Redis Node client package must be installed in runtime:
yarn add redis
Redis data layout
Input stream
- Stream key:
TASK_TRACKING_REDIS_STREAM_KEY(defaulttask-events:v1) - Message field:
event(JSON string)
Projected status (latest state)
- Per execution hash:
task-tracking:execution:{executionId} - Per project sorted set index:
task-tracking:project:{project}:executions- score:
occurredAttimestamp (ms) - value:
executionId
- score:
Ordering rule:
- Older out-of-order events do not overwrite newer projected state.
S3 archive layout
When TASK_TRACKING_S3_ARCHIVE_ENABLED=true, archived events are grouped by project/day and stored as newline-delimited JSON:
{TASK_TRACKING_S3_PREFIX}/{project}/{YYYY-MM-DD}/events-{timestamp}-{suffix}.jsonl
Example:
task-tracking/my-org/my-repo/2026-03-15/events-1700000000000-ab12cd.jsonl
Each file is immutable and contains one JSON event per line.
If TASK_TRACKING_S3_ARCHIVE_ENABLED=false, archival is skipped and only Redis stream + projection remain active.
Rollout plan
- Provision Redis connectivity and runtime dependency (
redis) where Alakai runs. - Validate in staging:
- service starts without runtime init errors
- stream receives events
- projector keys are updated
- If historical archive is needed, enable:
TASK_TRACKING_S3_ARCHIVE_ENABLED=trueTASK_TRACKING_S3_BUCKET+ permissions
- Validate S3 JSONL object creation when archival is enabled.
- Roll out to production.
Rollback
Rollback for archival only:
- Set
TASK_TRACKING_S3_ARCHIVE_ENABLED=false - Restart Alakai
Effect: task tracking stream + projection continue; only S3 archival is disabled.
Related dashboard docs
Dashboard snapshot + realtime SSE read paths are documented in Task Dashboard.