Flow Builder

You can find the Flow Builder under Settings > Shop. It allows you to automate and easily customise your business processes without programming knowledge and enables you to take event-based actions to a whole new level. With the Flow Builder, you can specify event triggers even further with the help of rules. Depending on the event, you can, for example, automate the sending of emails and even have URL calls or changes to the order status carried out. You can find several example Flows here.

Under the menu item Settings > Shop > Flow Builder you will find an overview of all the business flows that have been created. In addition to whether a flow is active, the name and description of each flow are displayed, as well as the trigger that triggers the business process. In the upper bar you also have the option to sort the flows (1). The sorting options Active, Name or Trigger are available.
You can edit or delete the existing flows using the context menu on the right-hand side.
You can also edit it by simply clicking on the respective name. 
You can create an entirely new flow by clicking on the Add Flow button in the top right-hand corner, and you will be taken directly to the configuration of this flow. 
When you edit a flow or create a new one, the two tabs General and Flow are available.

General

In the General tab, you can define the general configurations for the flow.

Name (1): Enter the name here. This is used together with the description in the overview to distinguish this flow from others.
Description (2): Enter a meaningful description here. Since this description is visible in the overview, it will help you to quickly distinguish this flow from others.
Priority (3): If you have several flows that use the same trigger, you can specify which flow should be processed first.
Active (4): You can use this switch to activate or deactivate the flow.

Flow

In the Flow tab, you will find the actual Flow Builder. An intuitive but comprehensive editor with which you can specify which actions are triggered by a trigger. In addition, you have the option of defining conditions for these actions, under which the actions are to be executed.

After selecting a trigger, you can use the plus symbol to set one or more conditions and actions that will then be executed.

Trigger

Every flow begins with a trigger. This specifies when the flow is executed. Select the trigger for which you would like to create a flow.

You can choose from the following triggers:

EventDescriptionActions
checkout.order.return.createdTriggered when order return is createdSend mail to customer and administrator
state_enter.order_return.state.doneTriggered when order return enters the status "Done"Send mail to customer
state_enter.order_return.state.cancelledTriggered when order return enters the status "Cancelled"Send mail to customer
state_enter.order_return.state.in_progressTriggered when order return enters the status "In Progress"Send mail to customer
checkout.customer.before.loginTriggered as soon as a customer logs inNo action
checkout.customer.loginTriggered as soon as a customer logs inAdd/remove tag
checkout.customer.logoutTriggered when a customer logs outAdd/remove tag
checkout.customer.deletedTriggered if a customer gets deletedAdd/remove tag, send mail
user.recovery.requestTriggered when a user creates a password recovery request at the AdminSend mail
checkout.customer.changed-payment-methodTriggered when a customer changes his payment method in the checkout processAdd/remove tag
checkout.order.placedTriggered when an order is placedAdd/remove tag, send mail, generate document, set order status
checkout.order.payment_method.changedTriggered when a customer changes payment method during the checkout processNo action
customer.recovery.requestTriggered when a customer recovers his passwordAdd/remove tag, send mail
checkout.customer.double_opt_in_registrationTriggered when a customer commits to his registration via double opt-inAdd/remove tag, send mail
customer.group.registration.acceptedTriggered when admin accepted a user who registered to join a customer groupAdd/remove tag, send mail
customer.group.registration.declined<Triggered when admin declined a user who registered to join a customer groupAdd/remove tag, send mail
checkout.customer.registerTriggered when a new customer was registeredAdd/remove tag, send mail
checkout.customer.double_opt_in_guest_orderTriggered as soon as double opt-in is accepted in a guest orderAdd/remove tag, send mail
checkout.customer.guest_registerTriggered when a new guest customer was registeredAdd/remove tag, send mail
contact_form.send<Triggered when a contact form is sentSend mail
mail.after.create.messageTriggered when a mail message/ content is createdNo action
mail.before.sendTriggered before a mail is sendNo action
mail.sentTriggered when a mail is sent from ShopwareNo action
newsletter.confirmTriggered when newsletter was confirmed by a userSend mail
newsletter.registerTriggered when user registered to subscribe to a sales channel newsletterSend mail
newsletter.unsubscribeTriggered when user unsubscribes from a sales channel newsletterSend mail
newsletter.updateDeprecated in 6.5.0Send mail
product_export.logTriggered when product export is executedNo action
state_enter.order_transaction.state.openTriggered when an order payment enters status "Open"Add/remove tag, send mail, generate document, set order status
state_leave.order_transaction.state.openTriggered when an order payment leaves status "Open"Add/remove tag, send mail, generate document, set order status
state_enter.order_transaction.state.paidTriggered when an order payment enters the status "Paid"Add/remove tag, send mail, generate document, set order status
state_leave.order_transaction.state.paidTriggered when an order payment leaves status "Paid"Add/remove tag, send mail, generate document, set order status
state_enter.order_transaction.state.refunded_partiallyTriggered when an order payment enters the status "Refunded partially"Add/remove tag, send mail, generate document, set order status
state_leave.order_transaction.state.refunded_partiallyTriggered when an order payment leaves the status "Refund partially"Add/remove tag, send mail, generate document, set order status
state_enter.order_transaction.state.chargebackTriggered when an order payment enters the status "Chargeback"Add/remove tag, send mail, generate document, set order status
state_leave.order_transaction.state.chargebackTriggered when an order payment leaves status "Chargeback"Add/remove tag, send mail, generate document, set order status
state_enter.order_transaction.state.paid_partiallyTriggered when an order payment enters the status "Paid partially"Add/remove tag, send mail, generate document, set order status
state_leave.order_transaction.state.paid_partiallyTriggered when an order payment leaves status "Paid partially"
state_enter.order_transaction.state.failedTriggered when an order payment enters the status "Failed"Add/remove tag, send mail, generate document, set order status
state_leave.order_transaction.state.failedTriggered when an order payment leaves status "Failed"Add/remove tag, send mail, generate document, set order status
state_enter.order_transaction.state.remindedTriggered when an order payment enters status "Reminded"Add/remove tag, send mail, generate document, set order status
state_leave.order_transaction.state.remindedTriggered when an order payment leaves status "Reminded"Add/remove tag, send mail, generate document, set order status
state_enter.order_transaction.state.authorizedTriggered when an order payment enters the status "Authorized"Add/remove tag, send mail, generate document, set order status
state_leave.order_transaction.state.authorizedTriggered when an order payment leaves the status "Authorized"Add/remove tag, send mail, generate document, set order status
state_enter.order_transaction.state.cancelledTriggered when an order payment enters the status "Cancelled"Add/remove tag, send mail, generate document, set order status
state_leave.order_transaction.state.cancelledTriggered when an order payment leaves status "Cancelled"Add/remove tag, send mail, generate document, set order status
state_enter.order_transaction.state.refundedTriggered when an order payment enters the status "Refunded"Add/remove tag, send mail, generate document, set order status
state_leave.order_transaction.state.refundedTriggered when an order payment leaves status "Refunded"Add/remove tag, send mail, generate document, set order status
state_enter.order_transaction.state.in_progressTriggered when an order payment enters the status "In progress"Add/remove tag, send mail, generate document, set order status
state_leave.order_transaction.state.in_progressTriggered when an order payment leaves status "In progress"Add/remove tag, send mail, generate document, set order status
state_enter.order_delivery.state.returned_partiallyTriggered when an order delivery enters the status "Return partially"Add/remove tag, send mail, generate document, set order status
state_leave.order_delivery.state.returned_partiallyTriggered when an order delivery leaves the status "Return partially"Add/remove tag, send mail, generate document, set order status
state_enter.order_delivery.state.returnedTriggered when an order delivery enters the status "Returned"Add/remove tag, send mail, generate document, set order status
state_leave.order_delivery.state.returnedTriggered when an order delivery leaves status "Returned"Add/remove tag, send mail, generate document, set order status
state_enter.order_delivery.state.cancelledTriggered when an order delivery enters the status "Cancelled"Add/remove tag, send mail, generate document, set order status
state_leave.order_delivery.state.cancelledTriggered when an order delivery leaves the status "Cancelled"Add/remove tag, send mail, generate document, set order status
state_enter.order_delivery.state.openTriggered when an order delivery enters status "Open"Add/remove tag, send mail, generate document, set order status
state_leave.order_delivery.state.openTriggered when an order delivery leaves the status "Open"Add/remove tag, send mail, generate document, set order status
state_enter.order_delivery.state.shippedTriggered when an order delivery enters the status "Shipped"Add/remove tag, send mail, generate document, set order status
state_leave.order_delivery.state.shippedTriggered when an order delivery leaves status "Shipped"Add/remove tag, send mail, generate document, set order status
state_enter.order_delivery.state.shipped_partiallyTriggered when an order delivery enters the status "Shipped partially"Add/remove tag, send mail, generate document, set order status
state_leave.order_delivery.state.shipped_partiallyTriggered when an order delivery status is changed from "Shipped partially" to another statusAdd/remove tag, send mail, generate document, set order status
state_enter.order.state.in_progressTriggered when an order enters the status "In progress"Add/remove tag, send mail, generate document, set order status
state_leave.order.state.in_progressTriggered when an order leaves the status "In progress"Add/remove tag, send mail, generate document, set order status
state_enter.order.state.completedTriggered when an order enters the status "Completed"Add/remove tag, send mail, generate document, set order status
state_leave.order.state.completedTriggered when an order leaves the status "Completed"Add/remove tag, send mail, generate document, set order status
state_enter.order.state.openTriggered when an order enters the status "Open"Add/remove tag, send mail, generate document, set order status
state_leave.order.state.openTriggered when an order leaves the status "Open"Add/remove tag, send mail, generate document, set order status
state_enter.order.state.cancelledTriggered when an order enters the status "Cancelled"Add/remove tag, send mail, generate document, set order status
state_leave.order.state.cancelledTriggered when an order leaves the status "Cancelled"Add/remove tag, send mail, generate document, set order status
state_enter.order_transaction.state.unconfirmedTriggered when an order payment enters the status "Unconfirmed"Add/remove tag, send mail, generate document, set order status
state_leave.order_transaction.state.unconfirmedTriggered when an order payment leaves the status "Unconfirmed"Add/remove tag, send mail, generate document, set order status
**Notice: Stop flow action: Available for all events.  

Condition

Conditions are used to refine the flow. For this purpose, the rules from the Rule Builder are used, or new rules are created directly for it. These rules can then be used to determine whether and which action is executed. For more extensive flows, several conditions can be queried one after the other.

Each condition has two possible outcomes. True or False. For each result, you can define additional conditions or actions that are then to be processed.

Delayed Actions

This feature allows you to trigger one or more actions after a certain period of time.

The time-delayed actions in the Flow Builder are available to you with the Shopware Beyond plan.

Due to the time-delayed actions you can send automated mails one week after an order, and ask for a product review, suggest other matching and offers for the product.

To configure the option, open a new or existing flow and go to the section Flow (1). There you can select a trigger (2) as usual.
Before you now select an action that will be triggered by the trigger, you can now set a delay (3). There you have the choice to set a value (4) when the following action should be executed.
The following configuration options are available: Hour, Day, Week, Month and User defined. If you select Custom, you can enter an individual value in the format SS.TT.WW.MM.

After configuring the delay, the usual action takes place.

As soon as your flow has been triggered, for example by an order, it will be listed in the Scheduled Actions section (1).
In the list you will find the delayed action (2) with an overview with the information.
Order number, Customer, Delayed action of condition, Time remaining, Scheduled for.

Action

The action is executed as soon as the trigger has been triggered and all preceding conditions have been fulfilled or not.

Depending on the trigger, not all actions may be available. For example, a tag can only be added if the trigger involves an entity to which a tag can be attached by default.

The following actions can be selected depending on the trigger:

 
Assign account status:
This action sets a customer to either active or inactive. Simply make a selection in the dropdown.

Assign affiliate and campaign code:
With this action, you can add an affiliate and/or campaign to the customer or order. The option override can be set if you want to override existing codes.

Assign customer group:
With this action, you can change the customer group. In the configuration dropdown, you can easily select the customer group.

Generate a document:
This action creates a new document in the current order. In the dropdown menu, you can define which document type should be created by this action.

Send mail:
With this action, you can have emails sent automatically. In the configuration, first, select a reply-to address ans a recipient. In addition to the administrator and the customer, this can also be one or more defined email addresses. Next, you select an email template that is to be sent and specify whether and which documents you want to add to the email.


Assign status:
This action allows you to change the payment status, shipping status and order status of the order affected by the trigger.

Some statuses are interdependent and can only be selected if the order already has a certain status.
For example, the payment status Refunded, Partially Refunded or Chargeback can only be assigned when the order has previously had the payment status Paid or Partially Paid. Other dependencies are listed here.

Stop flow
You can include this action in the Flow Builder at any point where nothing else should happen. For example, this can be the case if an action is only to be executed if the condition is true. If the condition is false, you then set the action Stop flow. It stops the entire flow, regardless of whether other actions are running in parallel in the flow. Subsequent actions or sequences are not executed. If "Stop flow" is executed in the first condition, the second condition, which was added by the "plus", is no longer called.

Set download access

If a digital product was purchased in the order and payment has been made, this action can be used to grand access or revoke the download link for the product in the customer login.

Change custom field content:
With this action, you can change the content of a custom field. You have the option to select the entity customer or order.

Add Tag / Remove Tag:
Here you can select an entity that is affected by the trigger and add or remove a tag to it.

Custom Trigger

Since the Shopware version (6.5.3.0), we have extended the Flowbuilder by an important feature. It is now possible to integrate triggers from other apps into the flow. This means that from now on, not only internal (in the Shopware cosmos) triggered actions can be selected, but also triggers executed in extensions such as order management or shipping systems or with interaction with social media or your newsletter tool. There are now three ways you can build and extend your flow.

  • Create flows within Shopware.

  • Create flows that start with an event in Shopware and trigger a flow via webhooks in third-party systems.

  • Create flows that start with an event in a third-party system and trigger a flow in Shopware.

How to prepare everything important for the use of custom flows can be found here.

Webhook Actions in Flow Builder

This extension is available to you from the Evolve Plan onwards. It extends the Flow Builder with additional helpful functions.

You need the Shopware Commercial extension to use the Webhook Actions.

Action: Call URL (Webhook)

With this action, you can have a web URL called automatically and pass parameters as soon as the trigger is fired. A WebHook makes it possible, for example, to tell a server software that a particular event, such as a new order, has occurred. This can be a notification or a request to the server to do something with the information.
General

Method (1): Generally, we support five different methods of a webhook.

  • GET: In this method, information is to be obtained from a remote resource.
  • POST: This method is used to transmit a piece of information to a remote resource.
  • PUT: The PUT method replaces information in the target resource with information in the current request.
  • PATCH: This method is used to make partial changes to a piece of information on the remote resource.
  • DELETE: This method can be used to remove a specific piece of information from the target resource.

URL (2): The URL specifies the destination to which the webhook should be sent.
Description (3): In the description, you can note this webhook's purpose to classify it correctly later.
Parameters (4): Depending on the goal and task of the webhook, it may be necessary to include parameters from the store system. You can do this via the parameters. To do this, enter a parameter name on the left side and select the parameter on the right side that will be transmitted to the target via this parameter name.
URL-Preview (5): Here, you can see a URL preview, including the specified parameters transmitted to the target.

Header-Parameters

Some servers that accept webhooks expect special header parameters. These can be stored here.

Body

Some servers that accept webhooks expect a special body. This can either be in the form of parameters that are passed in, like the header, or as code. Slack, for example, uses this to pass parameters. How the code should look is usually specified by the target server to which the webhook is sent. The Shopware variables can be accessed in the code.

Basic Auth

If the destination requires authentication, this can be activated here and the necessary access data stored.

Share Flows

Starting with Shopware version 6.4.19.0 and the Shopware Rise plan, you are able to share flows. You can use this to import or export flows in your store as well as create flows with an existing one. 

Download

To download a flow click on [...] (1) next to the desired flow and then on download (2). The flow file contains all sequences as well as the configurations used in conditions and actions. When uploading to a third-party system, missing data will be created.

References to categories, products and properties can be omitted from the flow file. When uploading to a third-party system, these missing references must be reassigned.

Upload

To upload a flow, go to Settings > Flow Builder, click the Upload Flow-button and select the file. 
If the file contains references to local files, the upload will check if these references exist on the target system. If these references are not present, the user will be prompted to reassign the data.

Flow templates

The template library contains flows provided by Shopware. It contains two types of flows: 

  • Standard flows, so you have the possibility to create them again.

  • Flows defined by Shopware for special use cases.

Was this article helpful?