EDI Writer
The EDI Writer component is designed to simplify the process of exchanging business documents with partners. In the Nappai automation system, it acts as a translator that takes your internal data (such as lists of items, prices, or shipping details) and converts it into a standardized EDIFACT file.
This is essential for B2B (Business-to-Business) communication, where systems need a common language to exchange information reliably. By using this component, you ensure that your purchase orders, delivery notes, or invoices are formatted correctly to be read by your partners’ systems.
How it Works
The component works by taking structured data from your workflow and organizing it according to specific rules for EDIFACT standards.
- Selection: You choose the type of document you want to create (e.g., a Purchase Order or an Invoice).
- Data Mapping: The component looks at the data you provide (such as buyer names, item lists, and totals). It maps this internal data into the specific sections required by the EDIFACT standard.
- Validation: It checks if all necessary information is present. For example, an invoice must have tax totals, while a shipping notice needs carrier details.
- Generation: Finally, it generates a file (typically a
.txtor.edifile) that follows strict formatting rules (using specific symbols to separate data). This file is ready to be sent to your trading partners via email, FTP, or other connectors in Nappai.
Inputs
Input Fields
The following fields are available to configure this component. Each field may be visible in different operations:
- Message Type: [Dropdown] Selects the standard document type to generate.
- Visible in: All operations
- Message Data: [Data Input] The structured data containing your document details. You must connect a Data node here.
- Visible in: All operations
- EDIFACT Version: [Dropdown] The directory version of the EDIFACT standard (e.g., D96A, D94B). This ensures compatibility with your partner’s system.
- Visible in: All operations
- Sender ID: [Text Input] Your organization’s identification code (GS1 or similar) for the interchange envelope.
- Visible in: All operations
- Recipient ID: [Text Input] The identification code of the company you are sending the document to.
- Visible in: All operations
- File Name: [Text Input] The name for the output file. If left blank, it will be auto-generated based on the message type and timestamp.
- Visible in: All operations
- Include Interchange Envelope: [Checkbox] If checked, the file will include the necessary header and footer markers (UNA/UNB/UNZ) required for transmission. Uncheck if you only need the raw message body.
- Visible in: All operations
Outputs
Output Data Example (JSON)
The component produces two main outputs. One is the binary file ready for storage/sending, and the other is the text string if you need to view or log the raw content. json { “EDI File”: “File Object: PurchaseOrder_20231027_001.edi”, “EDI Text”: “UNB+UNOC:3+0123456789012:14+9876543210987:14+231027:0915+0000000000001++++ORDER++INVOICE’\nUNH+1+ORDERS:D:96A:UN’\nBGM+220+ORDER-2023-001+9’\nDTM+2:20231027:102’\nNAD+BY+0123456789012::9’\n…” }
Note on Usage:
- EDI File: Use this output to connect to components like “File Writer” or “SMTP Sender” to store or send the actual document.
- EDI Text: Use this if you need to log the content, debug, or display the EDIFACT string in a report.
Connectivity
This component is typically positioned at the end of a data preparation workflow.
- Incoming Connections: It usually connects to a Data Mapper or Database Reader node. These previous steps provide the
Message Data(the structured JSON/List of items) that the writer needs to transform. - Outgoing Connections:
- EDI File: Connects to a File System Writer (to save to disk/S3), an SMTP/Email node (to email the partner), or an EDI Gateway (for API-based exchange).
- EDI Text: Connects to a Logger or Report Generator for auditing purposes.
Usage Example
Scenario: Automating Purchase Order Sending
- Retrieve Data: A “Database Reader” fetches a new order from your ERP system, returning a list of items with prices and quantities.
- Format Data: A “Data Mapper” organizes this into the required structure (Reference, Date, Buyer, Seller, Lines).
- Generate EDI: The EDI Writer node receives this data.
- Set Message Type to
ORDERS. - Set Sender ID to your company code.
- Set Recipient ID to the customer’s code.
- Set Message Type to
- Send: The output file is connected to an “SMTP Sender” node to email the order directly to the customer’s purchasing system.
Tips and Best Practices
- Data Completeness: Ensure your input data includes all mandatory fields for the selected document type. For example,
INVOICrequires tax amounts, whileDESADVrequires shipping carrier info. Missing data may cause the file to be rejected by partners. - Version Matching: Always check with your trading partners which EDIFACT Version they support. Mismatched versions are a common cause of communication errors.
- Testing: Use the EDI Text output to review the generated file in the Nappai logs before sending it live. This helps you spot formatting errors quickly.
- Envelopes: Most B2B exchanges require the Interchange Envelope (UNA/UNB/UNZ). Keep this checked unless your specific partner protocol specifies otherwise.
Security Considerations
- Data Privacy: Ensure that the
Message Datacontains only the necessary business information. Avoid including sensitive personal data (PII) unless required and compliant with regulations like GDPR. - Identification Codes: The Sender and Recipient IDs are critical for routing. Verify these codes are accurate to prevent documents from being sent to the wrong partner.
- File Access: When storing generated EDI files, ensure the destination storage (e.g., S3 bucket or Server) has appropriate access controls, as these files contain sensitive business transaction data.