Calling internal service endpoints in a Workflow
Last updated
Was this helpful?
Last updated
Was this helpful?
Your organization may have services that are not publicly accessible but contain information that would be useful to manage in Cortex. You can use an and to call internal services without exposing the service or authentication outside of your firewall.
Before getting started, you should have already and .
This guide describes using a Docker compose file, but note that Axon Relay can be run in Kuberenetes or other container systems.
As an example throughout this guide, assume a service in the network has the following endpoint:
GET http://cities.internal.my-company.com/api/cities/s => ["Seattle", "Sydney", "Shanghai" ...]
Create a file that defines how requests are routed.
The example below permits any requests, but note that the method
and path
can be narrowed to allow access to specific endpoints:
In your configuration, you will enter the root of your service URL as the value of origin
.
Create an accept file (in this example, docker-compose.yml
) that defines how the container will route traffic and which routes are allowed.
For production employments, two replicas should be specified. The example below can be used to test the system.
Start the container, which will register it with Cortex: Run the command docker compose up
.
Add an HTTP request block to your Workflow. Configure the block:
Block name: Enter a human readable name.
Slug: Enter a unique identifier for the block.
HTTP method: GET
URL: Enter a URL in the following format: http://[your-configuration-alias]@relay-proxy.cortex.io[/desired/url/path]
For the example from this guide, it would be http://axon-relay-cities@relay-proxy.cortex.io/api/cities/s
After saving your changes, run the Workflow.
Click Run at the top of the Workflow.
After running the Workflow, check its Outputs for the "Call cities endpoint" data:
Follow the and .
Headers: For more information on headers, see the .
Learn more about Workflow runs in .