Documentation Index
Fetch the complete documentation index at: https://docs.mavera.io/llms.txt
Use this file to discover all available pages before exploring further.
Scenario
Your content team creates brief tasks in Asana with structured descriptions: topic, target audience, content type, key messages, and SEO keywords. When a brief task moves to “Brief Complete” status, this job automatically generates a full content draft using Mavera’s Generate endpoint, then attaches the draft URL as a comment on the Asana task. Editors pick up drafts instead of blank pages. Flow: AsanaGET /tasks (filter: “Brief Complete” section) → Extract brief fields → Mavera POST /api/v1/generations → POST /tasks/{id}/stories (attach result as comment)
Code
Example Output
Error Handling
Section names vary
Section names vary
The code searches for sections containing “brief complete” (case-insensitive). If your workflow uses different names like “Ready for Writing” or “Approved Brief”, adjust the search string.
Comment character limits
Comment character limits
Asana story (comment) text is limited to 100,000 characters. Long drafts are truncated to 15,000 chars. For very long content, post a summary comment with a link to the full draft in a shared doc.
Moving tasks between sections
Moving tasks between sections
The
addTask/removeTask section endpoints are separate calls. If the “Draft Ready” section doesn’t exist, the task stays in “Brief Complete” — no error is thrown, just no movement.Duplicate runs
Duplicate runs
Running this job twice generates duplicate drafts. Add a check: before generating, fetch task stories and skip if a comment containing “Auto-generated draft” already exists.