Skip to main content
Responses and exceptions create blocks of steps that only run for a specific outcome of a workflow step:
  • Handle Response creates a block that runs when the step completes without an error and returns a given code.
  • Handle Exception creates a block that runs when the step fails with a KO. A code is optional and narrows the exception down to one specific error.
Codes are generally text or numbers returned by providers. Only some steps will return codes along with their status signals. For example, the Send invoice to VERI*FACTU step will return the error code as specified by the AEAT along with the KO status signal. Since GOBL already handles many of the validations in tax authorities lists, we recommend only implementing conditions which happen in your workflow with certain regularity and which should be handled automatically. As an example, we will handle the case where a supplier is not registered in the taxpayer census by the AEAT:
1

Add a response or exception on the step

On the desired step, click on the menu button ... and select Handle Exception. Select Handle Response instead to act on a code returned without an error.
Step menu with the Handle Response and Handle Exception options
2

Configure the code to match

Handle Response and Handle Exception forms with a code selector and a custom code field
In the form that opens:
  1. Code: leave it as Custom.
  2. Custom Code: 4107 (Tax ID not identified in the taxpayer census). Leave it empty to match any failure of the step.
  3. Click Add exception handler.
3

Add actions to the block

Workflow with response and exception blocks nested under their steps
The new block appears under the step, labelled with its code, and the right sidebar lists the available actions. Select one to handle the case as you wish, for example sending a Slack message for manual intervention.To end the workflow after the block, open the menu on the block’s label and select Add stop.

Error handling

Any step that causes an error (KO) from which the job can’t recover, and is not handled through an exception, will trigger the error handling flow. Add the steps you want to execute when the job fails to the Handle Exceptions section at the bottom of the canvas (often setting the entry’s state to Error and possibly sending a notification).

FAQ

If your step conditions display a This step contains deprecated conditions warning, your workflow will continue working normally, but we recommend updating your workflow so that you can modify it without unexpected behavior.Steps under deprecated conditions will display with a warning symbol ⚠️ with the label “Go to [action name]”. Click on the menu button ... and select “Replace”, and then select the replacement action from the sidebar. So, for example, if the deprecated step is labelled “Go to Set state”, replace this step with “Set state” and choose the same configuration as the original step (which you should find further down within the same workflow).Once all deprecated steps are replaced, locate the referenced action(s) and delete.