← All N8N workflows
Data & databasesCodeGmailGmail TriggerGoogle SheetsIf

Example of EDI Message

Configured with Gmail, Gmail Trigger, Google Sheets, Split Out. Review the connections and setup before adapting this template.

Workflow preview
TransformOrder InformationEdit FieldsData storeReturn OrdersGoogle SheetsData storeOutbound OrdersGoogle SheetsRoutingOrder TypeIfTriggerEmail TriggerGmail TriggerRoutingSubject includes EDIIfTransformExtract BodyEdit FieldsMessagingGet EmailGmailCodeParse EDI MessageCodeTransformOrder Info + OrderlinesMergeCodeFlatten Data toOrderlinesCodeTransformSplit Out by LineSplit Out

Node categories in this workflow

  • Transform
  • Data store
  • Routing
  • Trigger
  • Messaging
  • Code

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
Order InformationTransformEdit FieldsSee node parameters
Return OrdersData storeGoogle Sheetsappend
Outbound OrdersData storeGoogle Sheetsappend
Order TypeRoutingIfSee node parameters
Email TriggerTriggerGmail TriggerSee node parameters
Subject includes EDIRoutingIfSee node parameters
Extract BodyTransformEdit FieldsSee node parameters
Get EmailMessagingGmailget
Parse EDI MessageCodeCodeSee node parameters
Order Info + OrderlinesTransformMergeSee node parameters
Flatten Data to OrderlinesCodeCodeSee node parameters
Split Out by LineTransformSplit OutSee 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

None declared. HTTP requests and Code nodes may still need configuration.

Workflow notes

5. Do you need more details?

5. Do you need more details?

Find a step-by-step guide in this tutorial 🎥 Watch My Tutorial

1. Workflow Trigger with Gmail Trigger

1. Workflow Trigger with Gmail Trigger

The workflow is triggered by a new email received in your Gmail mailbox. If the subject includes the string "EDI" we proceed, if not we do nothing.

How to setup?

Example of EDI Message

Example of EDI Message

You can send yourself this email to test the workflow.

UNA:+.? ' UNB+UNOC:3+SENDER_ID+RECEIVER_ID+240317:1200+ORDER67890' UNH+1+ORDERS:D:96A:UN' BGM+220+PO56789012+9' DTM+137:20250318:102'
DTM+2:20250325:102'
DTM+10:20250324:102'
NAD+BY+BUYER_ABC::91' NAD+SU+SUPPLIER_XYZ::91' NAD+DP+WAREHOUSE_001::91' NAD+DP+Main Distribution Center' LIN+1++987654:IN' IMD+F++:::Product X Description' QTY+21:50:EA' PRI+AAA:20.00' LIN+2++654987:IN' IMD+F++:::Product Y Description' QTY+21:150:EA' PRI+AAA:12.75' UNT+10+1' UNZ+1+ORDER67890'UNA:+.? ' UNB+UNOC:3+SENDER_ID+RECEIVER_ID+240317:1200+ORDER67890' UNH+1+ORDERS:D:96A:UN' BGM+220+PO56789012+9' DTM+137:20250318:102'
DTM+2:20250325:102'
DTM+10:20250324:102'
NAD+BY+BUYER_ABC::91' NAD+SU+SUPPLIER_XYZ::91' NAD+DP+WAREHOUSE_001::91' NAD+DP+Main Distribution Center' LIN+1++987654:IN' IMD+F++:::Product X Description' QTY+21:50:EA' PRI+AAA:20.00' LIN+2++654987:IN' IMD+F++:::Product Y Description' QTY+21:150:EA' PRI+AAA:12.75' UNT+10+1' UNZ+1+ORDER67890'

2. Get Email Body & Parse EDI Message

2. Get Email Body & Parse EDI Message

The first node extracts the email body using the ID from the trigger. This body is parsed using the code node to extract order information.

How to setup?

4. Store the Transactions in a Google Sheet

4. Store the Transactions in a Google Sheet

This block will filter the order based on the order type (Return Orders, Outbound Orders) extracted from the order information node. Results are stored in two distinct sheets of the same Google Sheet file.

How to setup?

  • Add Results in Google Sheets:
    1. Add your Google Sheet API credentials to access the Google Sheet file
    2. Select the file using the list, an URL or an ID
    3. Select the sheet in which the vocabulary list is stored
    4. You don't need to create columns as the mapping is automatic. Learn more about the Google Sheet Node
3. Process Parsed Data

3. Process Parsed Data

This block extract order information and format the orderlines to be stored in a google sheet.

How to setup?

Nothing to do.

Example of EDI Message

Example of EDI Message

Purpose and structure

This folder contains the Example of EDI Message workflow. Its executable nodes use code, gmail, gmailTrigger, googleSheets, if, merge, set, splitOut. 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

Email 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/Splitout/0793_Splitout_Code_Send_Triggered.json MIT; preserve source notices.

More in Data & databases