Skip to main content
Version: ACE 5

Swapping URLs

note

The attached flow contains a REST HTTP Step with a workspace variable in place of the URL.

Defining the variable

Create and save a new variable with the following form values:

  • Name: remoteServiceUrl
  • Value: https://dev.ace-designer-server.sapienspaas.com/ace-echo
note

URL https://dev.ace-designer-server.sapienspaas.com/ace-echo depends on POST /ace-echo endpoint being available. Feel free to provide your own URL.

Referencing variable in flow

Navigate to the REST HTTP Step in the imported flow. The step target URL is configured to be {{$env.remoteServiceUrl}}. This is known as an expression. The step will resolve the value defined in the variable.

note

Variables can be accessed in any step configurations with minor differences. Read more about expressions and globals in ACE here.

Testing the flow

Test the flow. If the POST /ace-echo service is available you will receive a successful response with no errors. The workspace variable can be modified to update the target URL without making changes in the flow itself.

Test result (success)
{
"doc": {
"result": {
"doc": {},
"globals": {
//...
}
}
},
"errors": []
}