Swirls

SWIRLS_

  • How it works
  • Pricing

56 matches

OverviewDeliver client operations10Win and grow accounts8Resolve customer issues6Create and distribute content9Run people and operations5Review money and agreements3Monitor systems and data9Compose dependable work6

56 matches

OverviewDeliver client operations10Win and grow accounts8Resolve customer issues6Create and distribute content9Run people and operations5Review money and agreements3Monitor systems and data9Compose dependable work6
← Content & MediaFormView on GitHub

KB Article Generator

Generates knowledge base articles from support ticket patterns, scrapes existing docs to find gaps.

ai

Source

/**
 * Generates knowledge base articles from support ticket patterns,
 * with a human review gate before the article is published.
 */

form kb_request {
  label: "KB Article Request"
  schema: @json {
    {
      "type": "object",
      "required": ["topic", "common_questions"],
      "properties": {
        "topic": { "type": "string", "title": "Topic" },
        "common_questions": { "type": "string", "title": "Common Questions (one per line)" },
        "audience": {
          "type": "string",
          "title": "Audience",
          "enum": ["beginner", "intermediate", "advanced"]
        }
      }
    }
  }
}

workflow generate_kb_article {
  label: "Generate KB Article"

  root {
    type: code
    label: "Extract request"
    code: @ts { return context.nodes.root.input }
    outputSchema: @json {
      {
        "type": "object",
        "properties": {
          "topic": { "type": "string" },
          "common_questions": { "type": "string" },
          "audience": { "type": "string" }
        }
      }
    }
  }

  node research {
    type: ai
    label: "Research and outline"
    kind: object
    model: "google/gemini-2.5-flash"
    prompt: @ts {
      const req = context.nodes.root.output
      return "Create a detailed outline for a knowledge base article.\n\nTopic: " + req.topic + "\nCommon questions:\n" + req.common_questions + "\nAudience level: " + (req.audience || "intermediate") + "\n\nInclude sections, key points, and suggested code examples."
    }
    schema: @json {
      {
        "type": "object",
        "required": ["title", "sections"],
        "properties": {
          "title": { "type": "string" },
          "sections": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "heading": { "type": "string" },
                "key_points": { "type": "array", "items": { "type": "string" } },
                "needs_code_example": { "type": "boolean" }
              }
            }
          }
        }
      }
    }
  }

  node write_article {
    type: ai
    label: "Write full article"
    kind: text
    model: "google/gemini-2.5-flash"
    prompt: @ts {
      const outline = context.nodes.research.output
      return "Write a complete knowledge base article based on this outline. Use markdown formatting. Be clear and concise.\n\nTitle: " + outline.title + "\n\nOutline:\n" + JSON.stringify(outline.sections)
    }
    maxTokens: 2000
    temperature: 0.5
  }

  node review_article {
    type: code
    label: "Review article"
    code: @ts { return {} }
    review: {
      enabled: true
      title: "Review KB Article"
      description: "Review the generated article (see the write_article node output) before publishing. Approve to publish or reject to discard."
      schema: @json {
        {
          "type": "object",
          "properties": {
            "notes": { "type": "string", "title": "Reviewer Notes" }
          },
          "additionalProperties": false
        }
      }
      actions: [
        { id: "publish", label: "Publish", outcome: "approve" },
        { id: "discard", label: "Discard", outcome: "reject" }
      ]
    }
  }

  node publish {
    type: code
    label: "Publish article"
    code: @ts {
      const review = context.reviews.review_article || {}
      return {
        title: context.nodes.research.output.title,
        article: context.nodes.write_article.output,
        section_count: context.nodes.research.output.sections.length,
        reviewer_notes: review.notes || ""
      }
    }
  }

  flow {
    root -> research
    research -> write_article
    write_article -> review_article
    review_article -> publish
  }
}

trigger on_kb_request {
  form:kb_request -> generate_kb_article
  enabled: true
}

Flow

Trigger to workflow

kb_requestform
generate_kb_article
Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

Workflow nodes

CODE
Code Node
Extract request
AI
AI Node
Research and outline
AI
AI Node
Write full article
CODE
Code Node
Review article
CODE
Code Node
Publish article
Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.