Workflows
Setup & Configuration
Zara Workflows

Workflow Setup & Configuration

Configure and deploy automated workflows with Zara's intelligent orchestration engine

Example: Linear → GitHub → Vercel (2–5 min loop)

Prerequisites

Linear: API key with project access

GitHub: Personal access token with repo scope

Vercel: Project token for previews/deploys

Supabase: Project URL + anon key

Environment Variables

# .env
LINEAR_API_KEY=lin_...
GITHUB_TOKEN=ghp_...
VERCEL_TOKEN=vercel_...
SUPABASE_URL=https://...
SUPABASE_ANON_KEY=eyJ...

Workflow Flow

1Create a Linear issue with @codegen in description
2Zara agent opens a PR on GitHub
3GitHub Actions builds a Docker image
4Vercel posts a preview URL (comment + dashboard)
5Merge → auto-deploy to prod

CLI Commands

# Start workflow engine
npm run start:workflows

# Monitor workflows
npm run monitor:workflows

# View logs
npm run logs:workflows

Prerequisites

Before setting up workflows, ensure you have:

  • Linear Project: API key with project access
  • GitHub Repository: Personal access token with repo scope
  • Vercel Organization: Project link + token for previews/deploys
  • Supabase: Project URL + anon key
  • Zep Keys: For AI agent orchestration

Environment Configuration

Required Environment Variables

# Linear Configuration
LINEAR_API_KEY=your_linear_api_key
LINEAR_PROJECT_ID=your_project_id
 
# GitHub Configuration
GITHUB_TOKEN=your_github_pat
GITHUB_REPO=owner/repo-name
 
# Vercel Configuration
VERCEL_TOKEN=your_vercel_token
VERCEL_PROJECT_ID=your_project_id
VERCEL_ORG_ID=your_org_id
 
# Supabase Configuration
SUPABASE_URL=https://your-project.supabase.co
SUPABASE_ANON_KEY=your_anon_key
SUPABASE_SERVICE_ROLE_KEY=your_service_role_key
 
# Zara Configuration
ZARA_API_KEY=your_zara_api_key
ZARA_ENVIRONMENT=production

Environment File Setup

# Copy example environment file
cp .env.example .env
 
# Edit with your configuration
nano .env

Workflow Configuration

Basic Workflow Configuration

// workflow.config.js
module.exports = {
  // Workflow Engine Configuration
  engine: {
    maxConcurrent: 5,
    retryAttempts: 3,
    timeout: 300000, // 5 minutes
    notifications: ['slack', 'email', 'webhook']
  },
  
  // Linear Integration
  linear: {
    enabled: true,
    apiKey: process.env.LINEAR_API_KEY,
    projectId: process.env.LINEAR_PROJECT_ID,
    webhookUrl: process.env.LINEAR_WEBHOOK_URL
  },
  
  // GitHub Integration
  github: {
    enabled: true,
    token: process.env.GITHUB_TOKEN,
    repo: process.env.GITHUB_REPO,
    branch: 'main',
    autoMerge: false
  },
  
  // Vercel Integration
  vercel: {
    enabled: true,
    token: process.env.VERCEL_TOKEN,
    projectId: process.env.VERCEL_PROJECT_ID,
    autoDeploy: true
  },
  
  // Supabase Integration
  supabase: {
    enabled: true,
    url: process.env.SUPABASE_URL,
    anonKey: process.env.SUPABASE_ANON_KEY,
    serviceRoleKey: process.env.SUPABASE_SERVICE_ROLE_KEY
  }
}

Advanced Workflow Configuration

// advanced-workflow.config.js
module.exports = {
  // Workflow Triggers
  triggers: {
    linear: {
      issueCreated: true,
      issueUpdated: true,
      issueClosed: true,
      commentAdded: true
    },
    github: {
      prOpened: true,
      prMerged: true,
      prClosed: true,
      push: true
    },
    vercel: {
      deployStarted: true,
      deploySucceeded: true,
      deployFailed: true
    }
  },
  
  // Workflow Actions
  actions: {
    codeGeneration: {
      enabled: true,
      model: 'gpt-4',
      maxTokens: 2000,
      temperature: 0.7
    },
    testing: {
      enabled: true,
      framework: 'jest',
      coverage: true,
      parallel: true
    },
    deployment: {
      enabled: true,
      environments: ['preview', 'staging', 'production'],
      autoApprove: false
    }
  },
  
  // Notifications
  notifications: {
    slack: {
      enabled: true,
      webhook: process.env.SLACK_WEBHOOK_URL,
      channel: '#deployments'
    },
    email: {
      enabled: true,
      provider: 'sendgrid',
      apiKey: process.env.SENDGRID_API_KEY,
      from: 'noreply@yourcompany.com'
    }
  }
}

Workflow Types

Linear → GitHub → Vercel Workflow

This workflow automates the development process from issue creation to deployment:

  1. Issue Creation: Developer creates Linear issue with @codegen tag
  2. Agent Processing: Zara agent analyzes issue and generates code
  3. PR Creation: Agent creates GitHub PR with generated code
  4. CI/CD Pipeline: GitHub Actions runs tests and builds
  5. Preview Deployment: Vercel creates preview environment
  6. Review & Merge: Team reviews and merges PR
  7. Production Deployment: Vercel deploys to production

Market Intelligence Workflow

Automated market research and analysis:

  1. Data Collection: Gather data from multiple sources
  2. Analysis: AI agents analyze trends and patterns
  3. Report Generation: Create comprehensive reports
  4. Distribution: Send reports to stakeholders
  5. Monitoring: Track changes and updates

Content Generation Workflow

Automated content creation and publishing:

  1. Topic Research: AI agents research trending topics
  2. Content Creation: Generate articles, images, videos
  3. Quality Check: Review and validate content
  4. Publishing: Automatically publish to platforms
  5. Performance Tracking: Monitor engagement metrics

Monitoring & Analytics

Workflow Metrics

# View workflow performance
npm run metrics:workflows
 
# Check execution times
npm run analytics:workflows
 
# Monitor resource usage
npm run monitor:resources

Log Management

# View all workflow logs
npm run logs:workflows
 
# Filter by workflow type
npm run logs:workflows --type=linear-github-vercel
 
# Export logs for analysis
npm run logs:workflows --export=workflow-logs.json

Health Checks

# Run workflow health check
npm run health:workflows
 
# Check integration status
npm run status:integrations
 
# Verify webhook endpoints
npm run verify:webhooks

Troubleshooting

Common Issues

Workflow not triggering

Check webhook configuration and API keys:

npm run status:webhooks npm run verify:integrations npm run logs:workflows --level=error

Integration failures

Verify API keys and permissions:

npm run test:linear npm run test:github npm run test:vercel

Performance issues

Check resource usage and optimization:

npm run monitor:resources npm run optimize:workflows npm run performance:test

Next Steps

Learn More

Advanced Topics

  • Custom Workflow Types: Build specialized workflows
  • Integration Development: Create custom integrations
  • Performance Optimization: Optimize workflow execution
  • Security & Compliance: Implement security measures

Ready to Automate Your Workflows?

Start building intelligent, automated workflows with Zara today.