Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
a65d256
experimental sqlite cache
jbsmith7741 Apr 18, 2025
cf84a47
fixes: sqlite init
jbsmith7741 Apr 18, 2025
b4e38fc
Sqlite-alerts: Convert alert from file storage to sqlite cache (#236)
jbsmith7741 Sep 25, 2025
3cffcb0
make db configurable
jbsmith7741 Sep 25, 2025
d2e8914
update plan
jbsmith7741 Sep 26, 2025
8bfaeb0
add files cache and dashboard
jbsmith7741 Sep 26, 2025
a26aa42
update sqlite tasks plan
jbsmith7741 Sep 29, 2025
7d34027
task Dashboard: 1st draft
jbsmith7741 Sep 29, 2025
c205d86
UI refinement
jbsmith7741 Sep 30, 2025
83d6710
disable delete of tasks after TTL
jbsmith7741 Oct 1, 2025
66b6f3e
Add about page
jbsmith7741 Oct 1, 2025
5b9dc97
move css into single sytle.css
jbsmith7741 Oct 1, 2025
ef4f2f5
widen header and task view
jbsmith7741 Oct 2, 2025
46745b7
workflow spec
jbsmith7741 Oct 2, 2025
b7b60ec
css cleanup, interactive stat cards
jbsmith7741 Oct 3, 2025
0fff37a
fix style.css
jbsmith7741 Oct 3, 2025
5fa19a7
resolve static file hosting vs local running
jbsmith7741 Oct 3, 2025
b731ffb
backup sqlite db on close
jbsmith7741 Oct 8, 2025
4b469e4
1st draft of workflows in sqlite
jbsmith7741 Oct 8, 2025
2e023e2
workflow fixes and dashboard
jbsmith7741 Oct 9, 2025
962f975
unit test fixes
jbsmith7741 Oct 10, 2025
9c66f88
misc formating adjustments
jbsmith7741 Oct 17, 2025
935f314
table formating and other UI fixes
jbsmith7741 Oct 23, 2025
fd12959
tests around phase validation and update cron parser to have seconds …
jbsmith7741 Oct 24, 2025
bc05fd9
formatting changes
jbsmith7741 Oct 24, 2025
05eb8c5
icon change
jbsmith7741 Oct 24, 2025
21b0503
UI changes
jbsmith7741 Oct 24, 2025
3d42491
fix alerting escalation
jbsmith7741 Oct 30, 2025
70fce6e
fix issue with phase status not updating
jbsmith7741 Oct 31, 2025
3d772a3
add schema versioning
jbsmith7741 Oct 31, 2025
dfcdeb7
custom calendar that shows populated dates
jbsmith7741 Nov 4, 2025
e788d8c
v1 migration changes for workflow files
jbsmith7741 Nov 4, 2025
42a1c75
unit tests
jbsmith7741 Nov 5, 2025
16a497c
recap improvements: Autodetect granularity (month,day,year) and print…
jbsmith7741 Nov 6, 2025
2c8d35e
speed up populate date query
jbsmith7741 Nov 11, 2025
950bba8
speed up tasksHTML
jbsmith7741 Nov 13, 2025
68b0ad6
add compression to endpoints
jbsmith7741 Nov 14, 2025
53c04ba
reduce html/css/js complexity
jbsmith7741 Nov 14, 2025
aa7ab2b
Ensure old tasks are removed.
jbsmith7741 Nov 18, 2025
41691aa
refactoring of sqlite/cache and docs
jbsmith7741 Nov 18, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 41 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
version: 2
version: 2.1

jobs:
build:
executors:
go-executor:
docker:
- image: cimg/go:1.23
working_directory: ~/task-tools
working_directory: ~/task-tools

jobs:
test:
executor: go-executor
steps:
- checkout
- run: go install github.com/jstemmer/go-junit-report/v2@latest
Expand All @@ -23,4 +27,36 @@ jobs:
- store_artifacts:
path: ~/task-tools/junit
- store_artifacts:
path: tests.out
path: tests.out

build:
executor: go-executor
steps:
- checkout
- setup_remote_docker:
docker_layer_caching: false
- run:
name: "docker login"
command: echo ${DOCKERHUB_TOKEN} | docker login -u ${DOCKERHUB_USERNAME} --password-stdin
- run:
name: "Push Docker Image"
command: make docker

workflows:
version: 2
test_and_build:
jobs:
- test:
filters:
tags:
only:
- /.*/
- build:
requires:
- test
context:
- DOCKER
filters:
tags:
only:
- /.*/
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,7 @@ apps/utils/file-watcher/file-watcher
*/stats/stats
apps/workers/sql-load/sql-load
build
tasks.db
*_preview.html

coverage
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,16 @@ func (tm *taskMaster) Run(ctx context.Context) error {
## Pre-built Apps

### **Flowlord**
an all-purpose TaskMaster that should be used with workflow files to schedule when tasks should run and the task hierarchy. It can retry failed jobs, alert when tasks fail and has an API that can be used to backload/schedule jobs and give a recap of recent jobs run.
Production-ready task orchestration engine for managing complex workflow dependencies with intelligent scheduling, automatic retries, and real-time monitoring. Features include:

See Additional [docs](apps/flowlord/README.md).
- **Workflow Management** - Multi-phase workflows with parent-child task dependencies
- **Intelligent Scheduling** - Cron-based scheduling with template-based task generation
- **Optional SQLite Cache** - Task history, alerts, and file tracking for troubleshooting (non-critical, stateless operation)
- **Web Dashboard** - Real-time monitoring UI with filtering, pagination, and date navigation
- **Batch Processing** - Generate multiple tasks from date ranges, metadata arrays, or data files
- **RESTful API** - Comprehensive API for backloading, monitoring, and workflow management

See detailed [documentation](apps/flowlord/README.md).


### Workers
Expand Down
57 changes: 55 additions & 2 deletions apps/flowlord/README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,64 @@
# flowlord taskmaster
flowlord schedules and coordinates task dependency across workflows. Flowlord reads tasks from the done topic, failed tasks can be configured to retry a set number of times before being sent to slack and/or a retry_failed topic. Successful tasks will start children tasks.

![](flowlord.drawio.svg)
<img src="handler/static/favicon.svg" align="left" style="margin-right: 20px;" />

**Flowlord** is a production-ready task orchestration engine that manages complex workflow dependencies with intelligent scheduling, automatic retries, and real-time monitoring. Built on the [task](https://github.com/pcelvng/task) ecosystem, it coordinates distributed workers through message bus communication while providing visibility into task execution through a web dashboard.

**Key Features:**
- **Workflow Management** - Define multi-phase workflows with parent-child task dependencies
- **Intelligent Scheduling** - Cron-based scheduling with template-based task generation
- **Automatic Retries** - Configurable retry logic with exponential backoff and jitter to prevent thundering herd
- **File Watching** - Trigger tasks automatically when files are written to specified paths
- **Batch Processing** - Generate multiple tasks from date ranges, metadata arrays, or data files
- **Alerting** - Slack notifications for failed tasks and incomplete jobs with smart frequency management
- **RESTful API** - Web UI and API for monitoring workflows, viewing task history, and managing alerts

[![Static Badge](https://img.shields.io/badge/API%20Docs-green)](https://github.com/pcelvng/task-tools/wiki/Flowlord-API)

<br clear="all"/>

## Overview

![](flowlord.drawio.svg)

## Monitoring & Troubleshooting

SQLite is used to store phases and provides troubleshooting convenience by recording task history. As flowlord is stateless task management system, the cache persistent is not required for flowlord to work, but it convenient to review historical tasks and alerts. It is recommended to backup the task and alert logs for long term storage.

- **Task Records** - Full execution lifecycle with timing metrics
- **Alert History** - Failed task tracking for debugging
- **File Processing Audit** - Which files triggered which tasks
- **Workflow State** - Phase configuration and dependencies

The database is optional and non-critical. If deleted, Flowlord continues normally and rebuilds fresh data. Features:
- Automatic backup/restore from remote paths (S3/GCS)
- 90-day default retention with automatic cleanup
- WAL mode for concurrent access

**Configuration:**
```toml
[cache]
local_path = "./tasks.db" # required local cache
backup_path = "gs://bucket/tasks.db" # Optional backup location
retention = "2160h" # 90 days
task_ttl = "4h" # Alert deadline from task to complete (creation to complete)
```

## Web Dashboard

Built-in web UI for monitoring workflows and troubleshooting. Uses Go templates to render HTML dashboards with:
- Task execution history with filtering and pagination
- Alert summaries grouped by task type
- File processing history
- Workflow phase visualization
- System statistics

Access at `http://localhost:8080/` (or configured port)

| Files View | Tasks View | Alerts View | Workflow View |
|:----------:|:----------:|:-----------:|:-------------:|
| [![Files View](../../internal/docs/img/flowlord_files.png)](../../internal/docs/img/flowlord_files.png) | [![Tasks View](../../internal/docs/img/flowlord_tasks.png)](../../internal/docs/img/flowlord_tasks.png) | [![Alerts View](../../internal/docs/img/flowlord_alerts.png)](../../internal/docs/img/flowlord_alerts.png) | [![Workflow View](../../internal/docs/img/flowlord_workflow.png)](../../internal/docs/img/flowlord_workflow.png) |


## workflow
A workflow consists of one or more phases as a way to define of how a set of task is to be scheduled and run and the dependencies between them.
Expand Down
146 changes: 0 additions & 146 deletions apps/flowlord/cache/cache.go

This file was deleted.

Loading
Loading