Skip to main content

Create incoming invoices in work4all from email attachments with OpenAI

Workflow preview

Workflow preview
100%
Create incoming invoices in work4all from email attachments with OpenAI preview
Open on n8n.io

1. Workflow Overview

Quick Overview This sub workflow receives an email item with binary attachments, uses an OpenAI compatible chat completions endpoint to detect and extract invoice fields from PDF/XML/JSON files, an...

Best for

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

Tools used

n8n-nodes-base.stickynote, n8n-nodes-base.executeworkflowtrigger, n8n-nodes-base.if, n8n-nodes-base.code, n8n-nodes-base.httprequest, n8n-nodes-work4all.work4all, n8n-nodes-base.noop, n8n-nodes-base.set

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Christoph Baldow.

Original n8n.io source

1.1 Workflow description

Title
Create incoming invoices in work4all from email attachments with OpenAI
Workflow name
Create incoming invoices in work4all from email attachments with OpenAI

Quick Overview

This sub-workflow receives an email item with binary attachments, uses an OpenAI-compatible chat completions endpoint to detect and extract invoice fields from PDF/XML/JSON files, and then creates an incoming invoice in work4all with the relevant original attachments.

How it works

  1. Receives an item from a parent workflow via Execute Workflow Trigger containing the email metadata and binary attachments.
  2. Checks whether any attachments exist and skips processing if none are provided.
  3. Builds a chat-completions request that includes a strict JSON extraction prompt plus any readable PDF/XML/JSON attachment content.
  4. Sends the request to an OpenAI-compatible HTTP endpoint and parses the returned JSON to determine whether an invoice is present.
  5. If an invoice is found, filters to the relevant attachments, normalizes fields (forces EUR and converts dates), and adds entry/receipt dates from the email receivedDateTime.
  6. Creates the incoming invoice in work4all and returns the created invoice data and any errors along with the original message ID.
  7. If no invoice is found (or no readable attachments exist), returns a minimal “success” result with the original message ID to the caller.

Setup

  1. Add a work4all OAuth2 credential and ensure the verified work4all community node is installed.
  2. Add an OpenAI-compatible API credential and set the chat-completions URL (and required headers) in the HTTP Request step.
  3. Update the model name in the “Build LLM messages” code to one that supports file/PDF input for your chosen provider.
  4. Ensure the parent workflow passes a single email item with binary attachment properties plus id and receivedDateTime fields when calling this sub-workflow.

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 - Description

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

Block 2 - Sticky Note - Input

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

Block 3 - Sticky Note - Extract

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

Block 4 - Sticky Note - Book

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

Block 5 - When called by parent workflow

Type / Role
n8n-nodes-base.executeWorkflowTrigger - executeWorkflowTrigger
Config choices
Version 1.1

Block 6 - Has attachments?

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.3

Block 7 - Build LLM messages

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

Block 8 - Has readable attachment?

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.3

Block 9 - Call LLM

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

Block 10 - Parse extraction result

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

Block 11 - Has invoice?

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.3

Block 12 - Filter attachments & normalize

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

Block 13 - Create incoming invoice

Type / Role
n8n-nodes-work4all.work4all - work4all
Config choices
Version 1

Block 14 - Format work4all result

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

Block 15 - No invoice - skip

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

Block 16 - Build result (no invoice)

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

Block 17 - Extraction config

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 18 - Use work4all AI backend?

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.3

Block 19 - Extract invoice data

Type / Role
n8n-nodes-work4all.work4all - work4all
Config choices
Version 1

Block 20 - Sticky Note - Extraction mode

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

Block 21 - Sticky Note - Parse

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

Block 22 - Sticky Note - No invoice

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

3. Summary Table

Workflow Create incoming invoices in work4all from email attachments with OpenAI
Complexity advanced
Nodes 22
Categories Invoice Processing, AI Summarization
Author Christoph Baldow
Published 11 Jun 2026

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/16266/16266.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 Create incoming invoices in work4all from email attachments with OpenAI do?

Quick Overview This sub workflow receives an email item with binary attachments, uses an OpenAI compatible chat completions endpoint to detect and extract invoice fields from PDF/XML/JSON files, an...

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 Invoice Processing, AI Summarization use case.