To add a response to your Recipe, click the "+" button in the Recipe editor canvas and choose the Response step in the sidebar.
Following microservice best practice, you cannot add a step after a Response step. Therefore, a Response step will act as the end of your Recipe or as the final step within a conditional route. If a Response step is added in the middle of a Recipe, it will be skipped.
There are two pieces to a Response: its status code and its data.
In general, you should send the
200: OK status code if the Recipe ran successfully, you can choose from other commonly used status codes for more specific cases (e.g. if a Request failed, send an error response).
You can choose what data to send the response body using the key-value table to reference data from previous steps in the Recipe.
You can set a rule which will dictate if and when the Function step will execute. To do this, simply use the operators in the "Add your condition(s)" section found below the function editor.
If you set a condition for the function to execute and it isn't met, the function will be skipped and return the following output: