Building Custom Workflows
Learn how to create custom workflows that match your specific content processing needs.
Two Ways to Create Workflows
Section titled “Two Ways to Create Workflows”Use the build command to generate workflows from natural language:
looplia build "analyze podcast transcripts and create newsletter content"The AI will:
- Discover available skills
- Match your requirements
- Generate a valid workflow
See build command for details.
Create a workflow file directly in ~/.looplia/workflows/:
touch ~/.looplia/workflows/my-workflow.mdThen edit with your preferred editor.
Manual Workflow Creation
Section titled “Manual Workflow Creation”-
Create the workflow file
Terminal window # Create a new workflowcat > ~/.looplia/workflows/podcast-summary.md << 'EOF'---name: podcast-summaryversion: 1.0.0description: Summarize podcast transcripts into shareable contentsteps:- id: analyzeskill: media-reviewermission: |Analyze the podcast transcript to extract:- Main topics discussed- Key quotes from speakers (with attribution)- Actionable takeaways for listenersinput: ${{ sandbox }}/inputs/content.mdoutput: ${{ sandbox }}/outputs/analysis.json- id: shareableskill: writing-kit-assemblermission: |Create shareable content from the analysis:- 3 tweet-sized quotes (under 280 chars)- LinkedIn post summary (100-200 words)- Newsletter blurb (50-100 words)needs: [analyze]input: ${{ steps.analyze.output }}output: ${{ sandbox }}/outputs/shareable.jsonfinal: true---# Podcast Summary WorkflowTransforms podcast transcripts into shareable social content.## Usage\`\`\`bashlooplia run podcast-summary --file transcript.md\`\`\`EOF -
Test the workflow
Terminal window # Create a test transcriptecho "Host: Welcome to the show. Guest: Thanks for having me..." > test-transcript.md# Run your new workflowlooplia run podcast-summary --file test-transcript.md -
Iterate and refine
- Check outputs in
~/.looplia/sandbox/*/outputs/ - Adjust missions for better results
- Add validation criteria
- Check outputs in
Workflow Template
Section titled “Workflow Template”Here’s a template for common patterns:
---name: my-workflowversion: 1.0.0description: Short description of what this workflow does
steps: # Step 1: Analyze input content - id: analyze skill: media-reviewer mission: | Analyze the content to extract: - [List specific requirements] - [Include quantities where applicable] input: ${{ sandbox }}/inputs/content.md output: ${{ sandbox }}/outputs/analysis.json validate: required_fields: [field1, field2]
# Step 2: Transform/generate - id: transform skill: idea-synthesis # or another skill mission: | Based on the analysis: - [Describe transformation] - [Specify output format] needs: [analyze] input: ${{ steps.analyze.output }} output: ${{ sandbox }}/outputs/transformed.json
# Step 3: Assemble final output - id: assemble skill: writing-kit-assembler mission: | Combine inputs into final deliverable: - [Describe final format] needs: [analyze, transform] input: - ${{ steps.analyze.output }} - ${{ steps.transform.output }} output: ${{ sandbox }}/outputs/final.json final: true---
# My Workflow
Description and usage instructions...Available Skills
Section titled “Available Skills”These skills are available in the default installation:
Content Analysis
Section titled “Content Analysis”| Skill | Description |
|---|---|
media-reviewer | Deep content analysis, theme extraction, quote identification |
Content Generation
Section titled “Content Generation”| Skill | Description |
|---|---|
idea-synthesis | Generate hooks, angles, questions, prompts |
writing-kit-assembler | Combine inputs into structured output |
Design Patterns
Section titled “Design Patterns”Sequential Processing
Section titled “Sequential Processing”Steps run one after another:
steps: - id: step1 skill: media-reviewer # ...
- id: step2 skill: idea-synthesis needs: [step1] input: ${{ steps.step1.output }} # ...Fan-Out Pattern
Section titled “Fan-Out Pattern”One input feeds multiple parallel analyses:
steps: - id: analyze skill: media-reviewer input: ${{ sandbox }}/inputs/content.md output: ${{ sandbox }}/outputs/analysis.json
- id: social-content skill: writing-kit-assembler needs: [analyze] mission: Create social media posts input: ${{ steps.analyze.output }} output: ${{ sandbox }}/outputs/social.json
- id: newsletter skill: writing-kit-assembler needs: [analyze] mission: Create newsletter content input: ${{ steps.analyze.output }} output: ${{ sandbox }}/outputs/newsletter.jsonFan-In Pattern
Section titled “Fan-In Pattern”Multiple analyses combine into one output:
steps: - id: themes skill: media-reviewer mission: Extract themes # ...
- id: quotes skill: media-reviewer mission: Extract quotes # ...
- id: combined skill: writing-kit-assembler needs: [themes, quotes] input: - ${{ steps.themes.output }} - ${{ steps.quotes.output }} # ...Mission Writing Tips
Section titled “Mission Writing Tips”Be Specific
Section titled “Be Specific”# Vague (avoid)mission: Analyze the content
# Specific (better)mission: | Analyze the content to extract: - 3-5 main themes with supporting evidence - At least 5 quotable statements (under 280 characters each) - Key statistics or data points - Inferred target audienceInclude Format Requirements
Section titled “Include Format Requirements”mission: | Generate social media content: - 5 tweets (each under 280 characters, with hashtags) - 1 LinkedIn post (150-200 words, professional tone) - 1 Instagram caption (casual tone, with emoji suggestions)Provide Context
Section titled “Provide Context”mission: | Analyze this podcast transcript for a technology newsletter audience. Focus on: - Practical implications for developers - Controversial or surprising claims - Quotable insights from the guestValidation
Section titled “Validation”Add validation to ensure quality:
- id: analyze skill: media-reviewer validate: required_fields: [themes, quotes, keyPoints] min_quotes: 3 min_key_points: 5If validation fails, the step is marked incomplete and you can adjust and retry.
Debugging
Section titled “Debugging”Check Outputs
Section titled “Check Outputs”# View step outputscat ~/.looplia/sandbox/*/outputs/analysis.json | jq
# Check validation statecat ~/.looplia/sandbox/*/validation.jsonView Logs
Section titled “View Logs”# Session logscat ~/.looplia/sandbox/*/logs/session.logMock Mode
Section titled “Mock Mode”Test workflow structure without API calls:
looplia run my-workflow --file test.md --mockSee Also
Section titled “See Also”- Understanding Workflows — Schema reference
- build Command — AI-assisted creation
- run Command — Execution options