georgeguimaraes/elixir-agent-tools/oban
Claude Code and agent skill by georgeguimaraes/elixir-agent-tools
- community
Checking that the SKILL.md file is still in the repository.
Build and debug durable background jobs with Oban and Oban Pro. Use for workers, job argument serialization, retries, scheduled or recurring jobs, uniqueness, batches, and workflows. Use otp for in-memory tasks and process supervision.
Install
npx vskill@latest install georgeguimaraes/elixir-agent-tools/obanSKILL.md
Oban
Handle durable jobs, serialization, failures, and workflow composition with Oban.
Part 1: Oban (Non-Pro)
The Iron Law: JSON Serialization
This single fact causes most Oban debugging headaches.
Error Handling: Let It Crash
Don't catch errors in Oban jobs. Let them bubble up to Oban for proper handling.
Why?
- Automatic logging: Oban logs the full error with stacktrace
- Automatic retries: Jobs retry with exponential backoff
- Visibility: Failed jobs appear in Oban Web dashboard
- Consistency: Error states are tracked in the database
Anti-Pattern
Correct Pattern
When to Catch Errors
Only catch errors when you need custom retry logic or want to mark a job as permanently failed:
Snoozing for Polling
Use {:snooze, seconds} for polling external state instead of manual retry logic:
Simple Job Chaining
For simple sequential chains (JobA → JobB → JobC), have each job enqueue the next:
Don't reach for Oban Pro Workflows for linear chains.
Unique Jobs
Prevent duplicate jobs with the unique option:
Gotcha: Uniqueness is checked on insert, not execution. Two identical jobs inserted 61 seconds apart will both run.
High Throughput: Chunking
For millions of records, chunk work into batches rather than one job per item:
Use bulk inserts without uniqueness constraints for maximum throughput.
Part 2: Oban Pro
Cascade Context: Erlang Term Serialization
Unlike regular job args, cascade context preserves atoms:
Serialization Summary
| Creating | Processing | ||
|---|---|---|---|
| Regular jobs | atoms ok | strings only | |
| Cascade context | atoms ok | atoms ok |
When to Use Workflows
Reserve Workflows for:
- Complex dependency graphs (not just linear chains)
- Fan-out/fan-in patterns
- When you need recorded values across steps
- Conditional branching based on runtime state
Don't use Workflows for simple A → B → C chains.
Workflow Composition with Graft
When you need a parent workflow to wait for a sub-workflow to complete before continuing, use add_graft instead of add_workflow.
Key Differences
| Method | Sub-workflow completes before deps run? | Output accessible? | |
|---|---|---|---|
add_workflow | No - just inserts jobs | No | |
add_graft | Yes - waits for all jobs | Yes, via recorded values |
Pattern: Composing Independent Concerns
Don't couple unrelated concerns (e.g., notifications) to domain-specific workflows (e.g., scoring). Instead, create a higher-level orchestrator:
Recording Values for Dependent Steps
For a grafted workflow's output to be available to dependent steps, the final job must use recorded: true:
Dynamic Workflow Appending
Add jobs to a running workflow with Workflow.append/2:
Caveat: Cannot override context or add dependencies to already-running jobs. For complex dynamic scenarios, check external state in the job itself.
Fan-Out/Fan-In with Batches
To run a final job after multiple paginated workflows complete, use Batch callbacks:
Tip: Include pagination workers in the batch to prevent premature completion.
Testing Workflows
Don't use inline testing mode - workflows need database interaction.
For testing recorded values between workers, insert predecessor jobs with pre-filled metadata.
Red Flags - STOP and Reconsider
Non-Pro:
- Pattern matching on atom keys in
perform/1 - Catching all errors and returning
{:ok, _} - Wrapping job logic in try/rescue
- Creating one job per item when processing millions of records
Pro:
- Using
add_workflowwhen you need to wait for completion - Coupling notifications/emails to domain workflows
- Not using
recorded: truewhen you need output from grafted workflows - Using Workflows for simple linear job chains
- Testing workflows with inline mode
Any of these? Re-read the serialization rules.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingplugins/elixir-dev/skills/oban/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/georgeguimaraes/elixir-agent-tools/oban)