# Common n8n workflow examples

## Practical n8n workflows for Tallyfy automation

These examples show common n8n integration patterns with Tallyfy, complete with workflow structures and configuration details you can adapt directly.

> All Tallyfy API URLs require your organization ID. Replace `{org_id}` with your actual organization ID in every endpoint below.

### Example 1: CRM to Tallyfy process automation

Automatically [launch](/content/products/pro/launching/index.html) a customer onboarding [process](/content/products/pro/tracking-and-tasks/processes/index.html) when a deal is marked as “Won” in your CRM.

**Workflow components:**

1. **Webhook node** (or CRM-specific trigger)
   - Receives deal status change notifications
   - Filters for “Won” status only
2. **HTTP Request node** 
   - Method: GET
   - URL: Your CRM API endpoint for customer data
3. **HTTP Request node** 
   - Method: POST
   - URL: `https://go.tallyfy.com/api/organizations/{org_id}/runs`
   - Body:
   
   ```json
   {
     "checklist_id": "customer_onboarding_template_id",
     "name": "Onboarding - {{$json.customer_name}}",
     "kickoff": {
       "customer_name": "{{$json.customer_name}}",
       "email": "{{$json.email}}",
       "package": "{{$json.deal_type}}",
       "account_manager": "{{$json.assigned_to}}"
     }
   }
   ```
4. **Slack node** (optional)
   - Notify sales team about the process launch

### Example 2: Form submission to multi-system update

Update multiple systems whenever someone submits a Tallyfy [form](/content/products/pro/tracking-and-tasks/tasks/what-are-form-fields-in-tallyfy/index.html). You don’t need to copy data manually.

**Workflow components:**

1. **Webhook node**
   - Configure in Tallyfy to trigger on task completion
   - Filter for specific form-containing tasks
2. **IF node** 
   - Condition: `{{$json.task.blueprint_step_id}} == "form_step_id"`
3. **Set node** 
   - Map Tallyfy form fields to standardized variables
4. **HTTP Request node** 
   - Method: PUT
   - URL: CRM contact endpoint
5. **Google Sheets node** 
   - Append row with form data and timestamp
6. **Email node** 
   - To: Form submitter with summary of submitted data

### Visualizing n8n workflow patterns

This diagram shows how n8n workflows handle multi-system updates with conditional branching and retry logic.

**What to notice:**

- **Parallel branches** 
- **Conditional path**

### Example 3: Scheduled process launcher with data collection

Launch weekly review processes that automatically gather data from your tools.

**Workflow components:**

1. **Schedule Trigger node**
   - Cron expression: `0 9 * * 1` (every Monday at 9 AM)
2. **HTTP Request node** 
   - Connect to your analytics API for last week’s metrics
3. **HTTP Request node** 
   - Query helpdesk API for open tickets
4. **Code node** 
   
   ```javascript
   const salesTotal = items[0].json.total;
   const openTickets = items[1].json.count;
   const reviewData = {
        week_ending: new Date().toISOString().split('T')[0],
        sales_total: salesTotal,
        support_tickets: openTickets,
        review_priority: openTickets > 50 ? "High" : "Normal"
   };
   return [{json: reviewData}];
   ```
5. **HTTP Request node** 
   - Method: POST
   - URL: `https://go.tallyfy.com/api/organizations/{org_id}/runs`
   - Include collected data in kickoff fields

### Example 4: Document generation from completed processes

Generate PDF reports automatically when Tallyfy processes finish.

**Workflow components:**

1. **Webhook node**
   - Tallyfy webhook for process completion
2. **HTTP Request node** 
   - Method: GET
   - URL: `https://go.tallyfy.com/api/organizations/{org_id}/runs/{{$json.run_id}}`
3. **HTTP Request node** 
   - Method: GET
   - URL: `https://go.tallyfy.com/api/organizations/{org_id}/runs/{{$json.run_id}}/tasks`
4. **Code node** 
   
   ```javascript
   const tasks = $input.all();
   const reportData = {
        process_name: tasks[0].json.run.name,
        completed_date: new Date().toISOString(),
        task_summary: tasks[1].json.map(task => ({
          name: task.name,
          completed_by: task.completed_by_name,
          form_data: task.form_fields
        }))
   };
   return [{json: reportData}];
   ```
5. **HTML node** 
   - Generate formatted report layout
6. **Convert to PDF node** 
7. **Upload to cloud storage**

### Example 5: Intelligent task routing with AI

Use AI to analyze Tallyfy form responses and route tasks to the right people automatically.

**Workflow components:**

1. **Webhook node**
   - Trigger on Tallyfy form submission
2. **OpenAI node** (or similar AI service)
   - Analyze form content for urgency and category
3. **Switch node** 
   - Branch for each category/priority combination
4. **HTTP Request node** (multiple) 
   - Method: PUT
   - URL: `https://go.tallyfy.com/api/organizations/{org_id}/tasks/{{$json.task_id}}`
5. **Notification nodes**

### Example 6: Human-in-the-loop workflows

**Pattern:**

1. **AI generates content** (proposal, report, blog post)
2. **Workflow pauses** with Slack/Email notification for review
3. **Human reviews** and responds (approve/reject/modify)
4. **Workflow continues** based on the response

**Workflow components:**

1. **Trigger node** 
2. **AI Agent node** 
3. **Slack node** 
   - Action: **Send message and wait for reply**
4. **Switch node** 
5. **Action nodes**

**Use cases:**

- **Review proposals before delivery** 
- **Approve AI content before publishing** 
- **Validate data enrichment**

### Switch nodes for intelligent routing

**Pattern:**

```
Webhook → AI Agent (classify request) → Switch Node → Multiple specialized paths
```

**Configuration:**

1. **AI Agent node** 
2. **Switch node** 
3. **Specialized handling per path**

### Best practices for n8n + Tallyfy workflows

1. **Error handling**

```javascript
   On Error: Continue (Error Output)
   → Log error details
   → Send alert notification
   → Store failed data for retry
   ```
2. **Rate limiting** 
3. **Data validation** 
4. **Workflow organization** 
5. **Testing** 
6. **Retry settings** 
7. **Version history**

### Debugging tips

| Issue | Solution |
| --- | --- |
| **Workflow not triggering** | Check webhook is active in both n8n and Tallyfy |
| **Data not mapping correctly** | Use expression editor’s “Current Node” tab to see available data |
| **API errors** | Add HTTP Request “Full Response” option to see detailed errors |
| **Performance issues** | Split large workflows into sub-workflows |

### Advanced patterns

**Parallel processing**  
**Retry logic** with **Wait** and **IF** nodes:

1. Set a retry counter
2. On error, increment the counter
3. Wait exponentially longer between retries (2s, 4s, 8s)
4. Stop after max retries

**Data enrichment**
