← All N8N workflows
Data & databasesCodeExecute WorkflowExecute Workflow TriggerHTTP RequestIf

Example subworkflow for command WITHOUT Slack thread..

Configured with Execute Workflow, Execute Workflow Trigger, HTTP Request, Postgres, and additional nodes. Review the connections and setup before adapting this template.

Workflow preview
MessagingStart threadSlackWeb / APIsend helpHTTP RequestRoutingValidate Slack tokenIfWeb / APIReply to user thatcommand was receivedHTTP RequestRoutingif has workflowIfTransformSet configEdit FieldsWeb / APISend debug urlHTTP RequestRoutingif create threadIfWeb / APIAlert user that threadwas createdHTTP RequestMessagingAdd debug infoSlackSubworkflowExecute target workflowExecute WorkflowTransformAdd thread infoMergeRoutingHandle other commandsSwitchTransformSet thread infoEdit FieldsWeb / APIUnknown commandHTTP RequestTransformSet varsEdit FieldsTriggerWebhook to call forSlack commandWebhookWeb / APIReply to user directlyHTTP RequestTriggerCommand workflowtriggerExecute Workflow TriggerRoutingif has flagIfRoutingIf matches env variableIfWeb / APIFound userHTTP RequestCodeFormat data into nicestructureCodeTransformREPLACE ME WITH TRIGGEREdit FieldsData storeDelete user here forexamplePostgresData storeGet user here forexamplePostgresMessagingConfirm user wasdeletedSlackMessagingReplying to threadSlackCodeparse commandCodeCodeValidate webhooksignatureCode

Node categories in this workflow

  • Messaging
  • Web / API
  • Routing
  • Transform
  • Subworkflow
  • Trigger
  • Code
  • Data store

Icons describe general node roles, inferred from node types. Inspect the parameters for the configured action.

Drag to pan; use + and − to zoom. Reconstructed from the exported node positions; nothing runs here. Dashed lines represent non-main connections. Full node names and notes appear below.

How it works

The exported workflow contains the following configured nodes. Their connections are shown above; inspect the JSON for the complete logic, expressions, and external actions.

Workflow node names, types, and operations
NodeCategoryTypeOperation
Start threadMessagingSlackSee node parameters
send helpWeb / APIHTTP RequestSee node parameters
Validate Slack tokenRoutingIfSee node parameters
Reply to user that command was receivedWeb / APIHTTP RequestSee node parameters
if has workflowRoutingIfSee node parameters
Set configTransformEdit FieldsSee node parameters
Send debug urlWeb / APIHTTP RequestSee node parameters
if create threadRoutingIfSee node parameters
Alert user that thread was createdWeb / APIHTTP RequestSee node parameters
Add debug infoMessagingSlackSee node parameters
Execute target workflowSubworkflowExecute WorkflowSee node parameters
Add thread infoTransformMergeSee node parameters
Handle other commandsRoutingSwitchSee node parameters
Set thread infoTransformEdit FieldsSee node parameters
Unknown commandWeb / APIHTTP RequestSee node parameters
Set varsTransformEdit FieldsSee node parameters
Webhook to call for Slack commandTriggerWebhookSee node parameters
Reply to user directlyWeb / APIHTTP RequestSee node parameters
Command workflow triggerTriggerExecute Workflow TriggerSee node parameters
if has flagRoutingIfSee node parameters
If matches env variableRoutingIfSee node parameters
Found userWeb / APIHTTP RequestSee node parameters
Format data into nice structureCodeCodeSee node parameters
REPLACE ME WITH TRIGGERTransformEdit FieldsSee node parameters
Delete user here for exampleData storePostgresdeleteTable
Get user here for exampleData storePostgresselect
Confirm user was deletedMessagingSlackSee node parameters
Replying to threadMessagingSlackSee node parameters
parse commandCodeCodeSee node parameters
Validate webhook signatureCodeCodeSee node parameters

Setup

  1. Download the JSON and import it into an isolated n8n instance. Leave the workflow inactive.
  2. Connect your own credentials through n8n’s credential store. Replace REPLACE_WITH_* values with your resource identifiers.
  3. Inspect API destinations, Code nodes, database queries, file paths, and outbound actions.
  4. Run with synthetic data and harmless destinations. Enable triggers only after checking the actual outputs.

Requirements

An n8n instance with the listed node types and compatible versions. Service-connected workflows may require accounts, credentials, or paid APIs.

Credential types declared in the source

  • slackApi

Workflow notes

👨‍🎤 Setup

👨‍🎤 Setup

  1. Add Slack command and point it up to the webhook
  2. Add the following to the Set config node
  • alerts_channel with alerts channel to start threads on
  • instance_url with this instance url to make it easy to debug
  • slack_token with slack bot token to validate request
  • slack_secret_signature with slack secret signature to validate request
  • help_docs_url with help url to help users understand the commands
  1. Build other workflows to call and add them to commands in Set Config. Each command must be mapped to a workflow id with an Execute Workflow Trigger node
  2. Activate workflow 🚀
Example subworkflow for command WITH Slack thread..

Example subworkflow for command WITH Slack thread..

Build this in a second separate workflow

and add the id to commands in Set Config

Used Edit Fields node here as trigger because you can only have one Execute Workflow Trigger per workflow

Example subworkflow for command WITHOUT Slack thread..

Example subworkflow for command WITHOUT Slack thread..

Purpose and structure

This folder contains the Example subworkflow for command WITHOUT Slack thread.. workflow. Its executable nodes use code, executeWorkflow, executeWorkflowTrigger, httpRequest, if, merge, postgres, set, slack, switch, webhook. The table and connection map below are derived from the JSON, not an inferred guarantee of behavior.

Setup

Import inactive. Configure your own credentials and replace REPLACE_WITH_* values. Review external destinations and Code nodes before running.

Entry points

Webhook to call for Slack command, Command workflow trigger

Verification

Sanitized source candidate; not runtime-tested. This overview is generated from node metadata. Read the folder README for the connection map, credential types, and license.

Attribution

https://github.com/Zie619/n8n-workflows/blob/94007c1445d9258a7da116646b79473e7c7c3282/workflows/Webhook/0453_Webhook_Code_Create_Webhook.json MIT; preserve source notices.

Canvas section labels

These name areas of the original canvas; they do not include explanatory instructions.

  • Example subworkflow for command WITHOUT Slack thread..
  • 👆🏽 Set all custom config here

More in Data & databases