Core
Workflows
Inngest orchestration for content generation and publishing.
Workflows
InkHive uses Inngest for durable, observable execution of multi-step AI tasks.
Content generation pipeline
Function: contentPipeline (inngest/functions/content-pipeline.ts)
Trigger: content/generate event
Config: 3 retries, parallelism enabled
Steps
- Mark project status as
"generating". - Generate blog post (must complete first — downstream steps depend on it).
- In parallel, generate:
- Social media posts (Twitter, LinkedIn, Facebook, Instagram, Medium)
- Email newsletter (subject lines, HTML, plain text)
- SEO metadata (slug, title, description, keywords)
- On success, set status to
"completed". - On error, call
recordErrorwith the failing step and stack trace.
Inputs
{
projectId: string;
inputType: "topic" | "article";
inputContent: string;
}Convex mutations called
| Mutation | Purpose |
|---|---|
updateProjectStatus | Set overall project status |
saveBlogPost | Store generated blog content |
saveSocialPosts | Store all platform-specific posts |
saveEmailNewsletter | Store email content and subject lines |
saveSeoMetadata | Store SEO fields |
recordError | Log failures with step context |
Failure handling
- Each step is wrapped in
step.runwith automatic retries. - If blog generation fails, the pipeline stops — downstream steps cannot run without it.
- If a parallel step (social, email, SEO) fails, other parallel steps continue. The failed step is recorded but does not block the rest.
Publishing pipeline
Function: publishContent (inngest/functions/publish-content.ts)
Trigger: content/publish event
Steps
- Fetch project snapshot from Convex.
- Run each platform publisher in parallel.
- Update per-platform publish status via
updatePublishStatus. - Return consolidated results.
Failure handling
- Platform failures are independent — a Twitter failure does not block LinkedIn publishing.
- Retries are configured at the function level.
- Exhausted retries are logged for observability via
onFailure.
Adding a new AI step
- Create
inngest/steps/ai-generation/<your-step>.tswith the prompt and parsing logic. - Wire it into
contentPipelineor a new Inngest function. - Add a Convex mutation to persist the output.
- Add tests and log token usage.