> ## Documentation Index
> Fetch the complete documentation index at: https://docs.humaniq.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# All

> Pre-built approval workflows for common business scenarios

<Note>
  These recipes provide ready-to-use approval workflows for common business scenarios. Each recipe is designed with industry best practices and compliance requirements in mind.
</Note>

## Featured Recipes

<CardGroup cols={2}>
  <Card title="Financial Services" icon="money-bill" href="/recipes/financial">
    Handle financial transactions, refunds, and approvals

    * Payment processing
    * Refund management
    * Wire transfers
    * Credit limit changes
  </Card>

  <Card title="Healthcare" icon="hospital" href="/recipes/healthcare">
    HIPAA-compliant workflows for medical operations

    * Patient data access
    * Treatment plan changes
    * Medication approvals
    * Remote care authorization
  </Card>

  <Card title="Legal Operations" icon="scale-balanced" href="/recipes/legal">
    Document control and compliance workflows

    * Contract review
    * Court filings
    * Legal holds
    * Document classification
  </Card>

  <Card title="Customer Service" icon="headset" href="/recipes/customer-service">
    Customer-facing approval flows

    * Complaint escalation
    * Account modifications
    * Service credits
    * Bulk updates
  </Card>
</CardGroup>

## Quick Implementation

Get started quickly by choosing a recipe and adapting it to your needs:

```typescript theme={null}
import { needsHumanApproval } from '@your-org/approvals'

// Example: Basic refund approval
const processRefund = needsHumanApproval({
  type: 'sync',
  title: 'Refund Request',
  ask: (args) => `Approve refund of $${args.amount}?`,
  autoApprove: async (args) => args.amount < 100
})
```

## Common Patterns

<AccordionGroup>
  <Accordion title="Synchronous vs Asynchronous" icon="clock">
    Choose between blocking (sync) and non-blocking (async) approval flows based on your operational needs.

    ```typescript theme={null}
    // Synchronous - waits for approval
    const syncApproval = needsHumanApproval({
      type: 'sync',
      syncTimeout: 30000 // 30 second timeout
    })

    // Asynchronous - continues execution
    const asyncApproval = needsHumanApproval({
      type: 'async'
    })
    ```
  </Accordion>

  <Accordion title="Auto-Approval Rules" icon="robot">
    Implement conditional auto-approvals based on business rules.

    ```typescript theme={null}
    needsHumanApproval({
      autoApprove: async (args) => {
        return args.amount < 100 || 
               args.customerTier === 'VIP';
      }
    })
    ```
  </Accordion>

  <Accordion title="Multi-Approver Workflows" icon="users">
    Route approvals to different stakeholders based on criteria.

    ```typescript theme={null}
    needsHumanApproval({
      approvers: (args) => {
        if (args.amount > 10000) {
          return [
            { name: 'Manager', email: 'manager@company.com' },
            { name: 'Finance', email: 'finance@company.com' }
          ];
        }
        return [{ name: 'Team Lead', email: 'lead@company.com' }];
      }
    })
    ```
  </Accordion>
</AccordionGroup>

## Industry Solutions

<CardGroup cols={3}>
  <Card title="E-commerce" icon="cart-shopping">
    * Order processing
    * Refund management
    * Customer support
  </Card>

  <Card title="Banking" icon="building-columns">
    * Transaction approval
    * Account changes
    * Wire transfers
  </Card>

  <Card title="Insurance" icon="shield-halved">
    * Claims processing
    * Policy changes
    * Risk assessment
  </Card>
</CardGroup>

## Custom Integration

<Note>
  All recipes can be customized to match your specific requirements. Use them as starting points and modify as needed.
</Note>

```typescript theme={null}
// Example: Combining patterns
const customApproval = needsHumanApproval({
  type: 'sync',
  title: 'Custom Approval',
  ask: (args) => `Approve ${args.action}?`,
  // Custom auto-approval logic
  autoApprove: async (args) => {
    return await yourCustomLogic(args);
  },
  // Custom approval routing
  approvers: (args) => {
    return await getApproversFromSystem(args);
  },
  // Custom callbacks
  onApprovedCallbackUrl: 'https://your-system/approved',
  onRejectedCallbackUrl: 'https://your-system/rejected'
})
```

## Next Steps

<CardGroup cols={2}>
  <Card title="Implementation Guide" icon="book" href="/recipes/healthcare">
    Learn how to implement approval workflows for healthcare
  </Card>
</CardGroup>
