A template for a FinOpsBricks Orchestrator worker: a Node.js process that polls the Orchestrator for work and runs your step handlers. Built on @fob/lib-worker. Follow the steps below to create a new worker from this template.
cp -r worker-template worker-<org_name>
cd worker-<org_name>rm -rf .git
git initReplace all template placeholders throughout the project:
| Placeholder | Replace with | Example |
|---|---|---|
{{ORG_NAME}} |
Your org identifier (lowercase) | acme |
{{LOCATION}} |
Worker location for orchestrator routing | acme |
{{WORKER_NAME}} |
worker-<org_name> |
worker-acme |
{{WORKER_DESCRIPTION}} |
Short description | Worker for the acme org |
# macOS
grep -rl '{{ORG_NAME}}' . --include='*.js' --include='*.json' --include='*.md' | xargs sed -i '' 's/{{ORG_NAME}}/your_org/g'
grep -rl '{{LOCATION}}' . --include='*.js' --include='*.json' --include='*.md' | xargs sed -i '' 's/{{LOCATION}}/your_org/g'
grep -rl '{{WORKER_NAME}}' . --include='*.js' --include='*.json' --include='*.md' | xargs sed -i '' 's/{{WORKER_NAME}}/worker-your_org/g'
grep -rl '{{WORKER_DESCRIPTION}}' . --include='*.js' --include='*.json' --include='*.md' | xargs sed -i '' 's/{{WORKER_DESCRIPTION}}/Worker for the your_org org/g'cp .env.example .env
# Fill in credentials in .envnpm install- Add step handlers in
src/steps/{SHORT_CODE}__{station_slug}/using thedefineStep()pattern (see CLAUDE.md) - Add station JSONs in
.orchestrator/stations/{STATION}.jsonand push withfob-orc stations push --all - Add optional libraries as needed (see "Shared Libraries" in CLAUDE.md)
- Run with
npm run devduring development
Replace this setup guide with a standard worker readme:
# {{WORKER_NAME}}
{{WORKER_DESCRIPTION}}. See [CLAUDE.md](CLAUDE.md) for architecture and development details.
## Quick Start
\```bash
npm install
cp .env.example .env # fill in credentials
npm run dev
\```├── CLAUDE.md # Worker documentation (has placeholders)
├── README.md # This file
├── package.json # Dependencies and scripts (has placeholders)
├── jsconfig.json # JSDoc type-checking (checkJs: true)
├── jest.config.cjs # Jest config (ESM, 80% coverage targets)
├── .env.example # Environment variable template
├── .gitignore
├── src/
│ ├── index.js # Worker entry point (polls orchestrator, runs steps)
│ └── steps/ # Verb-step folders go here
├── tests/ # Jest tests
├── .orchestrator/
│ └── stations/ # Station JSON definitions (push with `fob-orc stations push --all`)
├── docs/ # Documentation
└── scripts/ # Utility scripts (one-shot tools, backfills)
temp/ is created at runtime and gitignored — that's where bins live (temp/stations/{STATION}/{input,doing,output,done,failed}/).