workly

package module
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 19, 2026 License: Apache-2.0 Imports: 1 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Workly

Release PyPI npm Docker image Docs

The open-source Cloud Tasks. Your app enqueues a task with a URL, and Workly delivers it as a signed HTTP request, retrying with backoff until your endpoint answers 2xx. Every attempt is kept with its status, error and response body. Run it locally, as a pod in your cluster, or hosted at workly.run.

Next to queues, schedules call an endpoint on a cron timetable, with the same retries, signing and history: cron for HTTP endpoints, separate from queues.

Beta: Workly is in beta. Until 1.0.0, a release may include breaking changes.

Install

pip install "workly[cli]"   # the Python SDK plus the workly binary
# or just the binary:
curl -fsSL https://raw.githubusercontent.com/worklydev/workly/main/install.sh | sh

Binaries for Linux, macOS and Windows are also on the releases page.

With Docker (the image runs workly serve by default; dev needs no configuration):

docker run -p 7337:7337 ghcr.io/worklydev/workly dev
docker run -p 7337:7337 -e WORKLY_DATABASE_URL=postgres://... -e WORKLY_SIGNING_SECRET=... ghcr.io/worklydev/workly

Try it

workly dev    # from a checkout: just dev

The dashboard is at http://localhost:7337.

Enqueue a task to the built-in echo target, which fails half the time:

curl -X POST localhost:7337/v1/queues/demo/tasks \
  -d '{"url": "http://localhost:7337/_dev/echo?fail_rate=0.5", "payload": {"hello": "world"}}'

Then follow its retries and final state in the dashboard, or:

curl localhost:7337/v1/tasks/<id>
curl localhost:7337/v1/tasks/<id>/attempts

Queues are created on first use. Configure them to limit how fast they deliver, then pause, resume or cancel their pending tasks:

curl -X PUT localhost:7337/v1/queues/demo -d '{"rate_per_second": 5, "max_concurrency": 2}'
curl -X POST localhost:7337/v1/queues/demo/pause

From Python, with the SDK (pip install workly):

from workly import Workly

task = Workly().tasks.enqueue("demo", url="http://localhost:7337/_dev/echo", payload={"hello": "world"})

From TypeScript, with the SDK (npm install @worklydev/sdk):

import { Workly } from '@worklydev/sdk';

const task = await new Workly().tasks.enqueue('demo', { url: 'http://localhost:7337/_dev/echo', payload: { hello: 'world' } });

Call an endpoint on a cron timetable with a schedule. Each call is a run, retried and recorded like a task:

curl -X PUT localhost:7337/v1/schedules/nightly -d '{"cron": "0 3 * * *", "timezone": "Europe/Stockholm", "url": "http://localhost:7337/_dev/echo"}'
curl -X POST localhost:7337/v1/schedules/nightly/trigger   # run it now

Fan out with a task group: enqueue tasks into a group, close it, and Workly enqueues one callback, with how they went, once they've all finished:

from workly import Callback, Workly

workly = Workly()
group = workly.groups.create(name="daily-stock-prices", on_complete=Callback(url="https://api.example.com/jobs/refresh-views"))
for company in companies:
    workly.tasks.enqueue("stock-prices", url="https://api.example.com/jobs/update-stock-price", payload={"symbol": company.symbol}, group_id=group.id)
workly.groups.close(group.id)

From your coding agent, over MCP: every server serves /mcp, so an agent can enqueue test tasks, see why deliveries fail and retry them once the handler is fixed. For Claude Code (Codex, Cursor and VS Code are in the MCP docs):

claude mcp add --transport http workly-dev http://localhost:7337/mcp

For hosted Workly, the Workly plugin adds the MCP server along with skills for debugging failed deliveries and for adding Workly to an app (Codex too). In Claude Code:

/plugin install workly --marketplace worklydev/workly

Or with the CLI:

workly tasks enqueue demo "http://localhost:7337/_dev/echo?fail_rate=0.5" -d '{"hello": "world"}'
workly tasks get <id>
workly queues ls
workly queues failures demo       # the queue's failed tasks, grouped by error
workly queues retry-failed demo   # after an outage: replay the queue's failed tasks
workly schedules ls               # schedules with their next and last run
workly runs ls --schedule nightly # a schedule's runs, newest first
workly groups ls                  # task groups with their progress

Keep queues and schedules in a workly.yaml and deploy them with your app (configuration as code):

workly plan                       # what would change
workly deploy --yes               # create and update until the server matches the file

Prometheus metrics are at /metrics (see docs/metrics.md).

To run Workly in production with Postgres, on Docker, Compose or Kubernetes, see docs/self-hosting.md. Every setting is in docs/configuration.md.

Deliveries are signed with Workly-Signature (HMAC-SHA256 of "<Workly-Timestamp>.<body>"). In workly dev the secret is workly-dev-secret.

Development

Requires Go 1.27+, Node 22+ (for the dashboard and the TypeScript SDK), uv (for the Python SDK), just and Docker (for Postgres tests).

just dev        # run a local server at http://localhost:7337
just build      # build bin/workly with the dashboard embedded
just dashboard-dev  # dashboard with hot reload on :5173, against `just dev`
just docs       # docs site with hot reload on :4321, from docs/
just test       # run tests
just test-all   # run tests against SQLite and Postgres
just loadtest   # load test a running server (see docs/performance.md)
just release-snapshot  # build release binaries and PyPI wheels locally

See AGENTS.md for repo conventions.

Contributing

Issues and pull requests are welcome; see CONTRIBUTING.md. Commits need a DCO sign-off (git commit -s). Report security problems privately, as in SECURITY.md.

License

Workly, its dashboard and its SDKs are licensed under the Apache License 2.0.

Documentation

Overview

Package workly holds the docs, embedded, so the server can hand them to agents (internal/docs). Go can only embed files at or below a package's directory, so this is at the root of the module.

Index

Constants

This section is empty.

Variables

View Source
var Docs embed.FS

Docs is docs/*.md and the SDKs' READMEs, as in the repo.

Functions

This section is empty.

Types

This section is empty.

Directories

Path Synopsis
cmd
workly command
Command workly is the Workly server and CLI.
Command workly is the Workly server and CLI.
Package dashboard serves the web UI, embedded into the binary.
Package dashboard serves the web UI, embedded into the binary.
internal
alert
Package alert tells people when tasks and schedule runs fail: by email, or in Slack through an incoming webhook.
Package alert tells people when tasks and schedule runs fail: by email, or in Slack through an incoming webhook.
api
Package api provides primitives to interact with the openapi HTTP API.
Package api provides primitives to interact with the openapi HTTP API.
client
Package client provides primitives to interact with the openapi HTTP API.
Package client provides primitives to interact with the openapi HTTP API.
config
Package config loads server configuration from WORKLY_* environment variables.
Package config loads server configuration from WORKLY_* environment variables.
cron
Package cron parses cron expressions and finds the times they match in a timezone.
Package cron parses cron expressions and finds the times they match in a timezone.
deploy
Package deploy reads a workly.yaml, which declares queues, workflows and schedules, and works out the changes that make a server match it.
Package deploy reads a workly.yaml, which declares queues, workflows and schedules, and works out the changes that make a server match it.
dispatch
Package dispatch delivers due tasks over HTTP.
Package dispatch delivers due tasks over HTTP.
docs
Package docs serves the docs embedded in the binary, by page, as the docs site names them (docs-site/scripts/sync.mjs): "index" for docs/README.md, "sdks/python" for sdks/python/README.md, otherwise the file's name.
Package docs serves the docs embedded in the binary, by page, as the docs site names them (docs-site/scripts/sync.mjs): "index" for docs/README.md, "sdks/python" for sdks/python/README.md, otherwise the file's name.
id
Package id generates prefixed ULIDs such as task_01J9ZK3M5Q8R2T4V6W8X0Y2Z4A. ULIDs sort by creation time, so IDs double as a stable pagination order.
Package id generates prefixed ULIDs such as task_01J9ZK3M5Q8R2T4V6W8X0Y2Z4A. ULIDs sort by creation time, so IDs double as a stable pagination order.
live
Package live tells dashboards when to refresh.
Package live tells dashboards when to refresh.
mcp
Package mcp serves Workly's tools to coding agents over the Model Context Protocol, at /mcp.
Package mcp serves Workly's tools to coding agents over the Model Context Protocol, at /mcp.
metrics
Package metrics collects Workly's metrics and serves them in the Prometheus text exposition format.
Package metrics collects Workly's metrics and serves them in the Prometheus text exposition format.
signing
Package signing signs and verifies deliveries.
Package signing signs and verifies deliveries.
store
Package store defines Workly's persistence interface.
Package store defines Workly's persistence interface.
store/migrate
Package migrate applies embedded SQL migrations.
Package migrate applies embedded SQL migrations.
store/postgres
Package postgres implements store.Store on PostgreSQL (14+).
Package postgres implements store.Store on PostgreSQL (14+).
store/sqlite
Package sqlite implements store.Store on SQLite, for `workly dev` and small single-replica self-hosted installs.
Package sqlite implements store.Store on SQLite, for `workly dev` and small single-replica self-hosted installs.
store/sqlstore
Package sqlstore holds the SQL shared by the postgres and sqlite stores.
Package sqlstore holds the SQL shared by the postgres and sqlite stores.
store/storetest
Package storetest is the conformance suite every store.Store implementation must pass.
Package storetest is the conformance suite every store.Store implementation must pass.
workspace
Package workspace resolves which workspace a request belongs to.
Package workspace resolves which workspace a request belongs to.
Package server is Workly's public Go API: the one package other modules (such as the hosted control plane) import to run and extend the server.
Package server is Workly's public Go API: the one package other modules (such as the hosted control plane) import to run and extend the server.
tools
loadtest command
Command loadtest measures Workly's sustained throughput and latency.
Command loadtest measures Workly's sustained throughput and latency.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL