Skip to content
Back to skills

215 Name Skill Ab069e9d

ASecurity

Create n8n workflow for daily task assignment from PTO engineer to foreman via Telegram bot with status reporting.

  • 9 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added May 31, 2026
businessjavascriptgojavabashsqlnodetestinggit

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned May 31, 2026

npx -y skills add tools-only/X-Skills --skill 215-name-skill_ab069e9d --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of 215 Name Skill Ab069e9d?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for 215 Name Skill Ab069e9d
[![Security: A β€” Skills Directory](https://www.skillsdirectory.com/api/skills/tools-only-215-name-skill-ab069e9d/badge)](https://www.skillsdirectory.com/skills/tools-only-215-name-skill-ab069e9d)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: "n8n-pto-pipeline"
description: "Create n8n workflow for daily task assignment from PTO engineer to foreman via Telegram bot with status reporting."
homepage: "https://datadrivenconstruction.io"
metadata: {"openclaw": {"emoji": "πŸ”§", "os": ["darwin", "linux", "win32"], "homepage": "https://datadrivenconstruction.io", "requires": {}}}
---
# n8n PTO-Foreman Pipeline

## Business Case

### Problem Statement
Daily work planning in construction involves:
- Manual task distribution from PTO (engineering) to field crews
- Paper-based or phone-based task assignment
- No systematic tracking of task completion
- Delayed reporting and status updates

### Solution
Automated n8n pipeline connecting Google Sheets task lists with Telegram bots for real-time task distribution and status collection.

### Business Value
- **Real-time distribution** - Tasks delivered automatically at 8:00 AM
- **Digital tracking** - All assignments and statuses in one table
- **Mobile-first** - Foremen use familiar Telegram interface
- **No app installation** - Works with any phone with Telegram

## Technical Implementation

### Architecture
```
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Google Sheets  │───>β”‚  n8n        │───>β”‚  Telegram Bot   β”‚
β”‚  (Task List)    β”‚    β”‚  Pipeline   β”‚    β”‚  (To Foreman)   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
        β–²                     β”‚                    β”‚
        β”‚                     β”‚                    β–Ό
        β”‚              β”Œβ”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”      β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
        └──────────────│   Status    β”‚<─────│  Foreman  β”‚
                       β”‚   Update    β”‚      β”‚  Response β”‚
                       β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜      β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
```

### n8n Pipeline Components

#### 1. Morning Trigger (8:00 AM)
```json
{
  "nodes": [
    {
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "parameters": {
        "rule": {
          "interval": [
            {"field": "hours", "hoursInterval": 24}
          ]
        },
        "triggerTimes": {"item": [{"hour": 8, "minute": 0}]}
      }
    }
  ]
}
```

#### 2. Get Tasks from Google Sheets
```json
{
  "name": "Get Today Tasks",
  "type": "n8n-nodes-base.googleSheets",
  "parameters": {
    "operation": "read",
    "sheetId": "YOUR_SHEET_ID",
    "range": "Tasks!A:F",
    "options": {}
  }
}
```

#### 3. Filter Tasks by Foreman
```javascript
// Filter tasks for specific foreman based on chat_id
const chatId = $node["Telegram Trigger"].json["message"]["chat"]["id"];
const tasks = $input.all();

return tasks.filter(task =>
  task.json.foreman_chat_id === chatId.toString()
);
```

#### 4. Format and Send via Telegram
```javascript
// Format task message
const tasks = $input.all();
let message = "πŸ“‹ *Π—Π°Π΄Π°Ρ‡ΠΈ Π½Π° сСгодня:*\n\n";

tasks.forEach((task, index) => {
  message += `*${index + 1}. ${task.json.task_name}*\n`;
  message += `   πŸ“ Участок: ${task.json.location}\n`;
  message += `   ⏰ Π‘Ρ€ΠΎΠΊ: ${task.json.deadline}\n`;
  message += `   πŸ“ ${task.json.description}\n\n`;
});

message += "\n_ΠžΡ‚Π²Π΅Ρ‚ΡŒΡ‚Π΅ Π½Π° это сообщСниС статусом:_\n";
message += "βœ… Π²Ρ‹ΠΏΠΎΠ»Π½ΠΈΠ»\n❌ Π½Π΅ Π²Ρ‹ΠΏΠΎΠ»Π½ΠΈΠ» + ΠΏΡ€ΠΈΡ‡ΠΈΠ½Π°";

return [{json: {message}}];
```

#### 5. Status Update Handler
```javascript
// Parse foreman response and update status
const message = $node["Telegram Trigger"].json["message"]["text"];
const replyTo = $node["Telegram Trigger"].json["message"]["reply_to_message"];

let status = "Π² Ρ€Π°Π±ΠΎΡ‚Π΅";
let comment = "";

if (message.toLowerCase().includes("Π²Ρ‹ΠΏΠΎΠ»Π½ΠΈΠ»")) {
  status = "Π²Ρ‹ΠΏΠΎΠ»Π½Π΅Π½ΠΎ";
} else if (message.toLowerCase().includes("Π½Π΅ Π²Ρ‹ΠΏΠΎΠ»Π½ΠΈΠ»")) {
  status = "Π½Π΅ Π²Ρ‹ΠΏΠΎΠ»Π½Π΅Π½ΠΎ";
  comment = message.replace(/Π½Π΅ Π²Ρ‹ΠΏΠΎΠ»Π½ΠΈΠ»/i, "").trim();
}

return [{
  json: {
    task_id: replyTo.message_id,
    status: status,
    comment: comment,
    updated_at: new Date().toISOString()
  }
}];
```

### Google Sheets Structure

**Tasks Sheet:**
| Column | Description |
|--------|-------------|
| task_id | Unique task identifier |
| task_name | Task title |
| description | Detailed description |
| location | Work location |
| deadline | Due date/time |
| foreman_chat_id | Telegram chat ID of assigned foreman |
| status | Current status |
| comment | Foreman comment |

**Foremen Sheet:**
| Column | Description |
|--------|-------------|
| name | Foreman name |
| chat_id | Telegram chat ID |
| registered_at | Registration timestamp |

### Telegram Bot Setup

1. Create bot via @BotFather
2. Get bot token
3. Configure webhook in n8n
4. For local testing, use n8n tunnel:
```bash
npx n8n --tunnel
```

## Usage Flow

### For PTO Engineer:
1. Open Google Sheets task list
2. Add tasks with foreman assignments
3. System automatically sends at 8:00 AM

### For Foreman:
1. Receive tasks via Telegram bot
2. Reply to task message with status
3. System updates Google Sheets automatically

### For Manager:
1. View real-time status in Google Sheets
2. Generate reports from historical data
3. Analyze completion rates by foreman/location

## Deployment Options

### Local (Testing)
```bash
npx n8n --tunnel
```

### Cloud VPS (Production)
- Hostinger n8n: ~$5/month
- Amvera Cloud: ~170 RUB/month
- timeweb: ~590 RUB/month

## Extensions

- Add photo attachments for completed work
- Integrate with PostgreSQL for complex queries
- Add reminder notifications
- Generate daily/weekly reports
- Connect to project management systems

## Resources

- **Source**: DDC Telegram Community discussions
- **Template**: Available in DDC GitHub repository

Files in this skill

  • README.md1.1 KB
  • skill.md5.9 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.