{"id":1702,"date":"2025-11-02T18:45:57","date_gmt":"2025-11-02T17:45:57","guid":{"rendered":"https:\/\/www.help.headlight.tech\/?post_type=ht_kb&#038;p=1702"},"modified":"2026-03-11T15:24:02","modified_gmt":"2026-03-11T14:24:02","slug":"invoice-management-with-headlight-part-4","status":"publish","type":"ht_kb","link":"https:\/\/www.help.headlight.tech\/?ht_kb=invoice-management-with-headlight-part-4","title":{"rendered":"Invoice management: Automation via Workflows"},"content":{"rendered":"\n<blockquote class=\"wp-block-quote\">\n<p>Part 4 of our collection of interactive videos to show how you can manage supplier invoices within the Headlight application.<\/p>\n<\/blockquote>\n\n\n\n<p>The Headlight invoice module saves tremendous time for the fleet manager in the approval process of invoices, as wel as for the Accounting department, via ready-to-use input files for the Analytical Accounting.<\/p>\n\n\n\n<p>See part 1 if you need an introduction to Invoice Management with Headlight, or see the <a href=\"https:\/\/www.help.headlight.tech\/?ht_kb=invoice-management-with-headlight-part-1\">overview of all related articles<\/a>.<\/p>\n\n\n\n<p><em>Let us know your questions or thoughts via support@headlight.tech.<\/em><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Automation via workflows<\/h2>\n\n\n\n<blockquote class=\"wp-block-quote\">\n<p>In this section, we&#8217;ll show you how you can put your invoice management on autopilot, using automatic triggers, generation, transformation and notification process steps.<\/p>\n<\/blockquote>\n\n\n\n<h3 class=\"wp-block-heading\">Headlight | Workflow triggers<\/h3>\n\n\n<p><!--ARCADE EMBED START--><\/p>\n<div style=\"position: relative; padding-bottom: calc(54.7222% + 41px); height: 0px; width: 100%;\"><iframe src=\"https:\/\/demo.arcade.software\/y9qOt1pJr7ZEqiffvIDA?embed&amp;embed_mobile=tab&amp;embed_desktop=inline&amp;show_copy_link=true\" title=\"Headlight | Add Accounting Centers\" frameborder=\"0\" loading=\"lazy\" webkitallowfullscreen=\"\" mozallowfullscreen=\"\" allowfullscreen=\"\" allow=\"clipboard-write\" style=\"position: absolute; top: 0; left: 0; width: 100%; height: 100%; color-scheme: light;\"><\/iframe><\/div>\n<p><!--ARCADE EMBED END--><\/p>\n\n\n<p>Every process in Headlight starts with a trigger.Workflow triggers allow you to automate actions in invoice management.<\/p>\n\n\n\n<p>You can set automatic triggers for events such as an invoice being created, approved, or consolidated.<\/p>\n\n\n\n<p>Each trigger connects directly to invoice documents in the system.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote\">\n<p>Triggers make it possible to automate follow-up steps like approvals, payments, or notifications. For example, when a consolidated supplier invoice is created, it can automatically be sent to the accounting team.<\/p>\n<\/blockquote>\n\n\n\n<ul>\n<li>Attachments and document references are included, so teams receive complete information. <\/li>\n\n\n\n<li>All settings are configurable through no-code options within the workflow editor.<\/li>\n\n\n\n<li>Select the type of trigger you want to use and browse the available options.<\/li>\n\n\n\n<li>You can also search and set parameters to match your process needs.<\/li>\n<\/ul>\n\n\n\n<p>Each workflow step\u2014sending a notification, updating a file, or launching an event\u2014can be defined within the same interface. Notifications can include custom text, such as:<\/p>\n\n\n\n<p>\u201cDear Accounting colleagues, <br>attached, you can find consolidated invoice {{consolidated_supplier_invoice.document_label}}. <br>Kind regards, <br>Fleet team.\u201d<\/p>\n\n\n\n<blockquote class=\"wp-block-quote\">\n<p>Once configured, workflows run automatically every time the trigger condition is met. This removes manual steps and ensures that invoice management runs faster and more consistently.<\/p>\n<\/blockquote>\n\n\n\n<h3 class=\"wp-block-heading\">Headlight | Create custom invoice files<\/h3>\n\n\n<p><!--ARCADE EMBED START--><\/p>\n<div style=\"position: relative; padding-bottom: calc(54.7222% + 41px); height: 0px; width: 100%;\"><iframe src=\"https:\/\/demo.arcade.software\/7WIz2VGcayOz9vukzPNk?embed&amp;embed_mobile=tab&amp;embed_desktop=inline&amp;show_copy_link=true\" title=\"Headlight | Add Accounting Centers\" frameborder=\"0\" loading=\"lazy\" webkitallowfullscreen=\"\" mozallowfullscreen=\"\" allowfullscreen=\"\" allow=\"clipboard-write\" style=\"position: absolute; top: 0; left: 0; width: 100%; height: 100%; color-scheme: light;\"><\/iframe><\/div>\n<p><!--ARCADE EMBED END--><\/p>\n\n\n<blockquote class=\"wp-block-quote\">\n<p>The <strong>Automated Invoice Processing<\/strong> workflow transforms uploaded Excel invoices into structured data. It fills missing details, calculates VAT codes, and generates descriptions for each line. The resulting file is then automatically emailed to the accounting department.<\/p>\n<\/blockquote>\n\n\n\n<p>Compared to the standard workflow, this version adds a <strong>Custom File Transformation <\/strong>step. Here, predefined scripts in Python can be applied to modify files according to specific formatting needs.<\/p>\n\n\n\n<p>Once the transformation completes, the custom file is saved and shared through an email notification. The message can include personalized text for colleagues, such as a note to the Accounts Payable team.<\/p>\n\n\n\n<p>These workflows can also incorporate conditional logic\u2014for example, sending results to different recipients depending on the legal entity\u2014offering a highly flexible automation setup.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Headlight | Create Custom Invoice Files \u2014 Step-by-Step Guide<\/h4>\n\n\n\n<blockquote class=\"wp-block-quote\">\n<p><strong>Purpose<\/strong>:<br>Automate the transformation of uploaded invoice files into structured, formatted data \u2014 ready for accounting or analytics workflows.<\/p>\n<\/blockquote>\n\n\n\n<h5 class=\"wp-block-heading\">1. Open the Automated Invoice Processing workflow<\/h5>\n\n\n\n<ul>\n<li>Navigate to Procurement &gt; Invoices &gt; Invoice.<\/li>\n\n\n\n<li>Select the Automated Invoice Processing workflow.<\/li>\n\n\n\n<li>This process handles Excel invoices and converts them into structured data.<\/li>\n<\/ul>\n\n\n\n<h5 class=\"wp-block-heading\">2. Understand the process<\/h5>\n\n\n\n<ul>\n<li>The workflow fills missing information, calculates VAT codes, and generates line descriptions automatically.<\/li>\n\n\n\n<li>Once completed, the system emails the processed invoice to the accounting team for documentation and record-keeping.<\/li>\n<\/ul>\n\n\n\n<h5 class=\"wp-block-heading\">3. Locate the Custom File Transformation step<\/h5>\n\n\n\n<ul>\n<li>This additional step allows the use of custom Python scripts to transform the Excel files.<\/li>\n\n\n\n<li>These scripts can apply predefined formatting rules or calculations to meet company-specific requirements.<\/li>\n\n\n\n<li>Example functions include <code>read_excel()<\/code>, <code>group_rows()<\/code>, and <code>idd_vat_results()<\/code> for refining the data.<\/li>\n<\/ul>\n\n\n\n<h5 class=\"wp-block-heading\">4. Edit or extend the transformation logic<\/h5>\n\n\n\n<ul>\n<li>The transformation logic runs through a <strong>Python handler function<\/strong> that uses safe built-in libraries such as:\n<ul>\n<li><code>pandas<\/code><\/li>\n\n\n\n<li><code>requests<\/code><\/li>\n\n\n\n<li><code>io<\/code><\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>You can use the event payload to access:\n<ul>\n<li><code>upload_link<\/code> \u2192 destination for the output file.<\/li>\n\n\n\n<li><code>invoice_doc.external_link<\/code> \u2192 source file location.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>The script applies transformations, then uploads the final file using:<br>&#8220;`python<br>write_to_excel(df, url)<\/li>\n<\/ul>\n\n\n\n<h5 class=\"wp-block-heading\">5. Review the email notification setup<\/h5>\n\n\n\n<ul>\n<li>The <strong>Invoice Processing Notification<\/strong> step automatically emails the processed file.<\/li>\n\n\n\n<li>The recipient (e.g., <em>accounting@company.com<\/em>) is notified once the document is ready.<\/li>\n\n\n\n<li>Example message:<\/li>\n<\/ul>\n\n\n\n<blockquote class=\"wp-block-quote\">\n<p>\u201cDear Accounts Payable department of company.company_name,<br>Attached you will find the processed invoice supplier_invoice.external_invoice_id from supplier_invoice.supplier_name.<br>Best regards,<br>Fleet team company.company_name\u201d<\/p>\n<\/blockquote>\n\n\n\n<h5 class=\"wp-block-heading\">6. Add custom communication or logic<\/h5>\n\n\n\n<ul>\n<li>You can include a <strong>personalized message<\/strong> for colleagues in the notification email.<\/li>\n\n\n\n<li>Extend the workflow with additional automation logic, such as:\n<ul>\n<li>Sending to different recipients per <strong>legal entity<\/strong>.<\/li>\n\n\n\n<li>Enabling <strong>one-click confirmation<\/strong> for faster approvals.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<h5 class=\"wp-block-heading\">7. Confirm workflow completion<\/h5>\n\n\n\n<ul>\n<li>Once the file transformation and notification steps are complete, the accounting team can immediately import the processed invoice.<\/li>\n\n\n\n<li>This automation ensures efficient documentation and eliminates manual formatting work.<\/li>\n<\/ul>\n\n\n\n<blockquote class=\"wp-block-quote\">\n<p><strong>Tip:<\/strong><br>Add a friendly message for colleagues \u2014 and remember, Headlight workflows can be extended endlessly with custom logic to fit your organization\u2019s needs.<\/p>\n<\/blockquote>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<blockquote class=\"wp-block-quote\">\n<p>Continued in <strong><a href=\"https:\/\/www.help.headlight.tech\/?ht_kb=invoice-management-with-headlight-part-5\">Part 5<\/a><\/strong><\/p>\n<\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>Part 4 of our collection of interactive videos to show how you can manage supplier invoices within the Headlight application. The Headlight invoice module saves tremendous time for the fleet manager in the approval process of invoices, as wel as for the Accounting department, via ready-to-use input files for the&#8230;<\/p>\n","protected":false},"author":3,"comment_status":"open","ping_status":"closed","template":"","format":"standard","meta":[],"ht-kb-category":[116],"ht-kb-tag":[43],"_links":{"self":[{"href":"https:\/\/www.help.headlight.tech\/index.php?rest_route=\/wp\/v2\/ht-kb\/1702"}],"collection":[{"href":"https:\/\/www.help.headlight.tech\/index.php?rest_route=\/wp\/v2\/ht-kb"}],"about":[{"href":"https:\/\/www.help.headlight.tech\/index.php?rest_route=\/wp\/v2\/types\/ht_kb"}],"author":[{"embeddable":true,"href":"https:\/\/www.help.headlight.tech\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.help.headlight.tech\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1702"}],"version-history":[{"count":5,"href":"https:\/\/www.help.headlight.tech\/index.php?rest_route=\/wp\/v2\/ht-kb\/1702\/revisions"}],"predecessor-version":[{"id":2658,"href":"https:\/\/www.help.headlight.tech\/index.php?rest_route=\/wp\/v2\/ht-kb\/1702\/revisions\/2658"}],"wp:attachment":[{"href":"https:\/\/www.help.headlight.tech\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1702"}],"wp:term":[{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/www.help.headlight.tech\/index.php?rest_route=%2Fwp%2Fv2%2Fht-kb-category&post=1702"},{"taxonomy":"ht_kb_tag","embeddable":true,"href":"https:\/\/www.help.headlight.tech\/index.php?rest_route=%2Fwp%2Fv2%2Fht-kb-tag&post=1702"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}