Files
Lucas Berger f330097906 docs(01): create phase plan
Phase 01: Foundation
- 2 plan(s) in 2 wave(s)
- Wave 1: Workflow setup (has human action checkpoint)
- Wave 2: Verification (human verify checkpoints)
- Ready for execution

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 18:47:27 -05:00

5.6 KiB

phase, plan, type, wave, depends_on, files_modified, autonomous, user_setup, must_haves
phase plan type wave depends_on files_modified autonomous user_setup must_haves
01-foundation 01 execute 1
n8n-workflow.json
false
service why account_setup env_vars
telegram Bot token required for n8n Telegram integration
task location steps
Create Telegram bot Telegram app -> @BotFather
Open Telegram, search for @BotFather
Send /newbot
Choose a name (e.g., 'Unraid Docker Manager')
Choose a username (must end with 'bot', e.g., 'unraid_docker_bot')
Copy the API token provided
name source
TELEGRAM_BOT_TOKEN BotFather response after /newbot
name source
TELEGRAM_USER_ID Send any message to @userinfobot to get your Telegram user ID
truths artifacts key_links
User can send a message to the Telegram bot
Bot responds only to authorized user ID
Unauthorized users receive no response (silent ignore)
Echo response includes original message and timestamp
path provides contains
n8n-workflow.json Complete n8n workflow definition Telegram Trigger
from to via pattern
Telegram Trigger node IF node message.from.id check from.id
from to via
IF node (true branch) Code node authenticated flow
from to via
Code node Telegram Send node echo message
Create the n8n workflow that receives Telegram messages, authenticates the user, and echoes messages back with timestamp.

Purpose: Establish the foundation for all bot communication - prove the Telegram <-> n8n round-trip works before adding Docker features. Output: Working n8n workflow that echoes messages back to the authorized user.

<execution_context> @/home/luc/.claude/get-shit-done/workflows/execute-plan.md @/home/luc/.claude/get-shit-done/templates/summary.md </execution_context>

@.planning/PROJECT.md @.planning/ROADMAP.md @.planning/STATE.md @.planning/phases/01-foundation/01-CONTEXT.md @.planning/phases/01-foundation/01-RESEARCH.md Task 1: Create Telegram Bot and Configure n8n User must complete external setup before workflow can be created:
  1. Create Telegram Bot:

    • Open Telegram, search for @BotFather
    • Send /newbot
    • Follow prompts for name (e.g., "Unraid Docker Manager")
    • Choose username ending with 'bot' (e.g., "unraid_docker_bot")
    • Save the API token provided
  2. Get Your Telegram User ID:

    • In Telegram, search for @userinfobot
    • Send any message
    • Note your "Id" value (numeric)
  3. Configure n8n Environment Variables:

    • Add to n8n container environment:
      • TELEGRAM_BOT_TOKEN=<your-bot-token>
      • TELEGRAM_USER_ID=<your-user-id>
    • Restart n8n container if needed
  4. Create Telegram Credential in n8n:

    • n8n UI -> Credentials -> Add -> Telegram API
    • Paste bot token in "Access Token" field
    • Save credential Type "done" when Telegram bot is created and n8n credential is configured
Task 2: Create n8n Workflow for Telegram Echo n8n-workflow.json Create an n8n workflow JSON file with the following structure:

Workflow: "Docker Manager Bot"

Node 1: Telegram Trigger

  • Type: n8n-nodes-base.telegramTrigger
  • Updates: "message"
  • Use the Telegram API credential

Node 2: IF (User Authentication)

  • Type: n8n-nodes-base.if
  • Condition: {{ $json.message.from.id.toString() }} equals {{ $env.TELEGRAM_USER_ID }}
  • True branch continues to echo
  • False branch: no connected nodes (silent ignore)

Node 3: Code (Format Echo)

  • Type: n8n-nodes-base.code
  • JavaScript code:
const message = $input.item.json.message;
const timestamp = new Date().toISOString();
const text = message.text || '(no text)';

return {
  json: {
    chatId: message.chat.id,
    text: `Got: ${text}\n\nProcessed: ${timestamp}`
  }
};

Node 4: Telegram (Send Message)

  • Type: n8n-nodes-base.telegram
  • Resource: message
  • Operation: sendMessage
  • Chat ID: ={{ $json.chatId }}
  • Text: ={{ $json.text }}
  • Parse Mode: HTML (for future formatting)

Connections:

  • Telegram Trigger -> IF
  • IF (true) -> Code
  • Code -> Telegram Send
  • IF (false) -> (nothing, ends workflow)

Save as n8n-workflow.json in the project root. This file can be imported into n8n.

Important: The workflow JSON should be valid for n8n import. Include proper node positions for visual layout.

  • File n8n-workflow.json exists
  • JSON is valid (parse without errors)
  • Contains all 4 nodes: telegramTrigger, if, code, telegram
  • IF condition references $env.TELEGRAM_USER_ID
  • n8n workflow JSON file created and valid
  • All nodes properly connected
  • User ID authentication configured via environment variable
1. Workflow JSON file exists at project root 2. JSON parses without errors 3. All required nodes present with correct types 4. IF node checks user ID from environment variable 5. Code node includes timestamp in output

<success_criteria>

  • n8n-workflow.json exists and is valid JSON
  • Workflow includes Telegram Trigger, IF (auth), Code (echo), Telegram Send
  • Authentication uses environment variable for user ID
  • Silent ignore implemented (no nodes on false branch) </success_criteria>
After completion, create `.planning/phases/01-foundation/01-01-SUMMARY.md`