Skip to main content

Train and deploy ML models with Claude and Slack approval

Workflow preview

Workflow preview
100%
Train and deploy ML models with Claude and Slack approval preview
Open on n8n.io

1. Workflow Overview

What this workflow does This workflow automates the full machine learning lifecycle end to end using Claude AI as the intelligent decision maker at every stage. Send one HTTP request with a dataset...

Best for

  • Engineering automation workflows
  • AI Summarization automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.stickynote, n8n-nodes-base.webhook, @n8n/n8n-nodes-langchain.chainllm, @n8n/n8n-nodes-langchain.lmchatanthropic, n8n-nodes-base.code, n8n-nodes-base.httprequest, n8n-nodes-base.slack

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Surya Vardhan Yalavarthi.

Original n8n.io source

1.1 Workflow description

Title
Train and deploy ML models with Claude and Slack approval
Workflow name
Train and deploy ML models with Claude and Slack approval

What this workflow does

This workflow automates the full machine learning lifecycle end-to-end using Claude AI as the intelligent decision-maker at every stage. Send one HTTP request with a dataset URL and a business goal — and the pipeline handles everything from raw CSV to a human-approved, documented model ready for GitHub.

The pipeline runs in 5 sequential phases:

Phase 1 — Strategy Claude Sonnet 4 receives the dataset URL, target variable, and business goal. It outputs a structured JSON plan covering feature ideas, algorithm choices, and the evaluation metric. A fallback parser ensures the pipeline continues even if the LLM output is slightly malformed.

Phase 2 — Data Engineering The workflow fetches the CSV via HTTP Request and runs it through a custom quoted-field CSV parser (handles commas inside quoted name fields, common in datasets like Titanic). It drops rows with missing targets, imputes missing Age values, and encodes categorical columns (Sex, Embarked) into numeric form.

Phase 3 — Feature Engineering Claude Haiku reviews the cleaned dataset and confirms the 3 best features to engineer. A Code node then creates FamilySize (SibSp + Parch + 1), IsAlone (binary flag), and TitleEncoded (extracted and mapped from passenger name). A row-count validation gate ensures no data is silently lost.

Phase 4 — Training & Evaluation Three algorithms are trained from scratch in pure JavaScript — no external ML libraries required:

  • Logistic Regression via gradient descent (200 epochs)
  • Random Forest via 10 bagged decision stumps
  • XGBoost via gradient boosting with residual-based stump selection

Precision, recall, F1, and accuracy are computed for each. Claude Sonnet then acts as an LLM judge: it reads all three result sets alongside the original business goal and selects the winner with a one-sentence justification. A deterministic fallback (highest F1) runs if the LLM response fails to parse.

Phase 5 — HITL Deployment Claude Sonnet writes a structured MODEL_CARD.md covering model overview, performance metrics, training data summary, feature engineering decisions, intended use, and limitations. The full results are then posted to a Slack channel as a formatted approval request. A human can review the results and reply to approve or reject deployment.

An optional Supabase audit log records each phase transition with timestamp, phase name, status, and run ID.


Tested results

Tested on the Titanic dataset (891 rows):

Model F1 Score Accuracy
Logistic Regression 0.712 0.787
Random Forest 0.739 0.804
XGBoost 0.761 0.821

Claude correctly identified XGBoost as the winner and generated a complete model card in under 10 seconds.


What you need

Requirement Details
Anthropic API key Used in P1, P4 (Claude Sonnet 4), and P3 (Claude Haiku). Get at console.anthropic.com
Slack Bot Token OAuth bot token with chat:write scope. Bot must be invited to the target channel via /invite @bot-name
Supabase project (optional) For audit logging. Replace YOUR_PROJECT.supabase.co and YOUR_SUPABASE_SERVICE_ROLE_KEY in the 5 log nodes, or delete them
Public CSV URL The dataset must be reachable by your n8n instance via HTTP GET

Setup steps

  1. Import the workflow JSON into your n8n instance
  2. Add your Anthropic API credential and assign it to the 3 lmChatAnthropic nodes (P1, P3, P4)
  3. Add your Slack Bot Token credential and assign it to the P5 Slack node. Replace YOUR_SLACK_CHANNEL_ID with your real channel ID (e.g. C012AB3CD)
  4. (Optional) Set up the Supabase audit log table using the SQL in the setup sticky note, then replace the two placeholder values in the 5 log HTTP Request nodes
  5. Activate the workflow and send a test request:
POST https://your-n8n-instance.com/webhook/mlops-v2
Content-Type: application/json

{
 "dataset_url": "https://raw.githubusercontent.com/datasciencedojo/datasets/master/titanic.csv",
 "target_variable": "Survived",
 "business_goal": "Predict passenger survival to optimise lifeboat boarding policy"
}

Extending the workflow

The Phase 5 sticky note includes a tip for extending the HITL loop: add a Webhook node to receive the Slack approval callback and an If node to branch into a GitHub API call that commits the model card to a new repository. The model_card_b64 field (Base64-encoded model card content) is already assembled in the payload, ready to be passed directly to the GitHub Contents API.


Node count & complexity

  • 28 nodes total (22 active, 6 sticky notes)
  • 3 LLM calls (Claude Sonnet ×2, Claude Haiku ×1)
  • 5 JavaScript Code nodes (all pure JS, no external libraries)
  • 5 Supabase log nodes (optional, deletable)
  • 1 Slack node
  • Fan-out connections used to run log nodes as parallel dead-ends without blocking the main data path

Tags

AI, Machine Learning, MLOps, Claude AI, Slack, Automation, Data Science, HITL, LLM

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 2 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 3 - P1: Receive MLOps Job

Type / Role
n8n-nodes-base.webhook - webhook
Config choices
Version 2

Block 4 - P1: Plan ML Strategy

Type / Role
@n8n/n8n-nodes-langchain.chainLlm - chainLlm
Config choices
Version 1.4

Block 5 - P1: Anthropic Sonnet

Type / Role
@n8n/n8n-nodes-langchain.lmChatAnthropic - lmChatAnthropic
Config choices
Version 1.3

Block 6 - P1: Parse Strategy

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 7 - P1: Log Strategy

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 8 - Sticky Note2

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 9 - P2: Log Data Eng

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 10 - Sticky Note3

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 11 - P3: Reason About Features

Type / Role
@n8n/n8n-nodes-langchain.chainLlm - chainLlm
Config choices
Version 1.4

Block 12 - P3: Anthropic Haiku

Type / Role
@n8n/n8n-nodes-langchain.lmChatAnthropic - lmChatAnthropic
Config choices
Version 1.3

Block 13 - P3: Parse Feature Plan

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 14 - P3: Engineer Features

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 15 - P3: Log Feature Eng

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 16 - Sticky Note4

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 17 - P4: Setup Algorithms

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 18 - P4: Train All Models

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 19 - P4: LLM Judge Best Model

Type / Role
@n8n/n8n-nodes-langchain.chainLlm - chainLlm
Config choices
Version 1.4

Block 20 - P4: Anthropic Sonnet Judge

Type / Role
@n8n/n8n-nodes-langchain.lmChatAnthropic - lmChatAnthropic
Config choices
Version 1.3

Block 21 - P4: Parse Judge Verdict

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 22 - P4: Log Training

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 23 - Sticky Note5

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 24 - P5: Generate Model Card

Type / Role
@n8n/n8n-nodes-langchain.chainLlm - chainLlm
Config choices
Version 1.4

Showing the first 24 of 30 workflow blocks. Download the JSON for the full node graph.

3. Summary Table

Workflow Train and deploy ML models with Claude and Slack approval
Complexity advanced
Nodes 30
Categories Engineering, AI Summarization
Author Surya Vardhan Yalavarthi
Published 01 Mar 2026

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/13781/13781.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Train and deploy ML models with Claude and Slack approval do?

What this workflow does This workflow automates the full machine learning lifecycle end to end using Claude AI as the intelligent decision maker at every stage. Send one HTTP request with a dataset...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Engineering, AI Summarization use case.