LogoLogo
Login to CortexBook a DemoCortex Academycortex.io
  • Cortex Docs
  • Cortex Quick Start
  • Ingesting data into Cortex
    • Managing Entities
      • Adding entities
        • Add services
        • Add domains
        • Add teams
        • Add custom entity types
        • Defining dependencies
      • Entity details page
      • Defining ownership
      • Defining relationship types
      • Grouping entities
      • Adding external documentation
      • Adding Deploy data
      • Adding custom data
      • Viewing discovered entities
      • Archiving entities
      • Relationship graph
      • Using On-call Assistant for incidents
      • Managing Terraform infra in Cortex
    • Managing Catalogs
    • Integrations
      • Internally hosted integrations
      • ArgoCD
      • AWS
      • Azure DevOps
      • Azure Resources
      • BambooHR
      • Bitbucket
      • BugSnag
      • Buildkite
      • Checkmarx
      • CircleCI
      • ClickUp
      • Codecov
      • Coralogix
      • Custom webhook integrations
      • Datadog
      • Dynatrace
      • Entra ID (Azure AD)
      • FireHydrant
      • GitHub
      • GitLab
      • Google
      • Grafana
      • incident.io
      • Instana
      • Jenkins
      • Jira
      • Kubernetes
      • LaunchDarkly
      • Lightstep
      • Mend
      • Microsoft Teams
      • New Relic
      • Okta
      • Opsgenie
      • PagerDuty
      • Prometheus
      • Rollbar
      • Rootly
      • Sentry
      • ServiceNow
      • Slack
      • Snyk
      • SonarQube
      • Splunk Observability Cloud (SignalFx)
      • Splunk On-Call (VictorOps)
      • Sumo Logic
      • Veracode
      • Wiz
      • Workday
      • xMatters
  • Scorecards
    • Initiatives and Action items
      • Creating issues based on Initiatives
    • Scorecard rule exemptions
    • Scorecard rule filters
    • Scorecard examples
    • Scorecards as code
  • Reports
    • Executive report
    • All Scorecards report
    • Bird's eye report
    • Progress report
    • Report card
  • Eng Intelligence
    • Custom Metrics
    • Jira Metrics
    • Metrics Explorer (Beta)
  • Cortex Query Language (CQL)
    • Using CQL reports
    • Using JQ in Cortex
  • Workflows
    • Creating a Workflow
      • Workflows as code
    • Blocks
    • Running a Workflow
    • Registering a Scaffolder template
      • Scaffolder advanced usage
    • Using a Workflow to sync in ArgoCD
    • Kicking off a Jenkins pipeline in a Workflow
    • Calling internal service endpoints in a Workflow
  • Plugins
    • Creating a plugin
      • Creating a plugin proxy
    • Migrating Backstage plugins to Cortex
  • Engineering homepage
  • Workspace Settings
    • Using GitOps for Cortex
      • GitOps logs
    • Managing users
      • Roles and permissions
        • Custom roles
        • Team ownership entity editing
      • Configuring SSO
        • Microsoft Entra ID
        • Google
        • Other OIDC providers
        • Okta
          • Okta SCIM
      • Configuring identity mappings
      • Onboarding management
    • API keys, secrets, and tokens
      • Secrets
      • Personal tokens
    • Audit logs
    • Entity settings
      • Data verification
      • Auto archiving entities
    • IP allowlist
    • Notifications
      • Notification logs
    • Customizing your workspace
    • Using search in Cortex
  • Cortex API
    • REST API operations
      • API Keys
      • Audit Logs
      • Catalog Entities
      • Custom Data
        • Custom Data (Advanced)
      • Custom Events
      • Custom Metrics
      • Dependencies
      • Deploys
      • Discovery Audit
      • Docs
      • Eng Intel: User Labels
      • Entity Relationship Types (Beta)
      • Entity Relationships (Beta)
      • Entity Types
      • GitOps Logs
      • Groups
      • Initiatives
      • Integrations APIs
        • Azure Active Directory (Entra ID) API
        • Azure Resources API
        • AWS API
        • Azure DevOps API
        • CircleCI API
        • Coralogix API
        • Datadog API
        • GitHub API
        • GitLab API
        • incident.io API
        • LaunchDarkly API
        • New Relic API
        • PagerDuty API
        • Prometheus API
        • SonarQube API
      • IP Allowlist
      • Notification Logs
      • On call
      • Packages
      • Plugins
      • Queries
      • SCIM
      • Scorecards
      • Secrets
      • Team Hierarchies
      • Teams
      • Workflows
Powered by GitBook
On this page
  • How to call internal service endpoints in a Workflow
  • Prerequisites
  • Step 1: Create request forwarding configuration
  • Step 2: Configure Axon Docker container
  • Step 3: Create the Workflow in Cortex

Was this helpful?

Export as PDF
  1. Workflows

Calling internal service endpoints in a Workflow

Last updated 15 hours ago

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.

How to call internal service endpoints in a Workflow

Prerequisites

Before getting started, you should have already and .

Considerations

  • 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" ...]

Step 1: Create request forwarding configuration

  • 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:

{
   "private": [
     {
       "method": "any", 
       "path": "/*",   
       "origin": "http://cities.internal.my-company.com"
     }
   ]
}

In your configuration, you will enter the root of your service URL as the value of origin.

Step 2: Configure Axon Docker container

  1. 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.

services:
 relay-cities:
   image: ghcr.io/cortexapps/cortex-axon-agent:latest
   environment:
     HOSTNAME: relay-cities-${HOSTNAME:-local}
     CORTEX_API_TOKEN: $CORTEX_API_TOKEN
   volumes:
     - "./accept.cities.json:/app/accept.json"
   command: [
     "relay",
     "-a", "axon-relay-cities", # this can be any unique value
     "-f", "/app/accept.json",
   ]
  1. Start the container, which will register it with Cortex: Run the command docker compose up.

Step 3: Create the Workflow in Cortex

  1. 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

  2. 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 .

Running a Workflow
Cortex's Axon Relay
set up the Cortex Axon agent
set your Cortex API token in the .env file
HTTP action in a Workflow
steps to start creating a Workflow
configure its basic details
HTTP request block documentation
The "call cities endpoint" data appears in the Output of the Workflow.