All use casesUse Case
Chain LLM steps and third-party APIs into reliable automated workflows.
Automation platforms need reliable async execution, retries, and webhook triggers as much as they need LLM calls. FastAPI AI Kit's Celery pipeline plus its unified LLM layer cover both halves of that problem.
FastAPICeleryRedisOpenAIStripePostgreSQL
The usual pain points
- ✕Triggering workflows reliably from inbound webhooks
- ✕Retrying failed steps without duplicating side effects
- ✕Mixing deterministic steps (API calls) with LLM-driven decision steps
- ✕Billing customers per workflow run or per step executed
How the kit solves them
- Celery's built-in retry/backoff handles failed steps without manual replay logic
- Webhook endpoints already documented for the GitHub/webhook-driven use case, reusable for other providers
- Unified LLM layer available inline as one step in a larger deterministic chain
- Stripe metering supports custom units — bill per run, per step, or per token
Example implementation
@celery.task(bind=True, max_retries=3)
def run_workflow_step(self, workflow_id: str, step: dict):
try:
if step["type"] == "llm_decision":
result = llm.chat(messages=step["prompt"], track_tokens=True)
else:
result = call_external_api(step)
advance_workflow(workflow_id, result)
except Exception as exc:
self.retry(exc=exc, countdown=2 ** self.request.retries)Ready to build your ai workflow automation backend?
FastAPI AI Kit ships with everything shown above, pre-configured and production-ready. Clone the repo and start building in minutes.
Ready to ship your AI backend this weekend?
Join developers who skipped weeks of boilerplate and went straight to building.
No subscriptions · One-time payment · Lifetime updates
