Skip to main content

Quickstart: Service Invocation

In this quickstart, you'll run a client and server application on Catalyst Cloud. You will learn how to:

  • Provision a Catalyst project with App IDs for two applications using the Diagrid CLI.
  • Invoke a remote service method from a client application using the Dapr Service Invocation API.
  • Verify successful service-to-service communication in the application logs and the Catalyst web console.

1. Prerequisites

Before you proceed, ensure you have the following prerequisites installed.

2. Log in to Catalyst

Authenticate to Diagrid Catalyst using the following command:

diagrid login

This command opens a new browser window where where you'll be shown a confirmation code that should match the code in your terminal. Confirm the code, and if you're not logged into Catalyst, you'll be redirected to login.

Confirm your user details are correct using the following command:

diagrid whoami

The expected output contains the name of the organization, your user name, and the Catalyst API endpoint.

3. Clone Quickstart Code

Clone the quickstart code from GitHub:

git clone https://github.com/diagridio/catalyst-quickstarts

Navigate to the quickstart directory:

cd catalyst-quickstarts/invocation/python

4. Install Dependencies

Install the dependencies for both the client and server applications.

Create and activate a Python virtual environment:

uv venv
source .venv/bin/activate

Install dependencies:

uv sync --active --directory client && uv sync --active --directory server

5. Run the application with Catalyst Cloud

The diagrid dev run command creates your Catalyst project, provisions resources (App IDs), configures environment variables, and launches your application connected to Catalyst Cloud.

diagrid dev run -f invocation-quickstart.yaml --project invocation-quickstart --approve
tip

Wait a few seconds until you see the log Connected App ID "server" to localhost:5002 in the terminal before proceeding to ensure both applications are up and running.

6. Invoke the service

With the quickstart running, test the Service Invocation API by sending a request from the client app to the server app.

6.1 Send a request

Open a new terminal and execute the following command to invoke the server app through the client app:

curl -i -X POST http://localhost:5001/order -H "Content-Type: application/json" -d '{"orderId":1}'

The expected response is:

HTTP/1.1 200 OK

In the diagrid dev run terminal, the server app logs should indicate the request was successfully received, and the client app logs should show the invocation was successful.

6.2 View in the Catalyst web console

Open the Catalyst Cloud web console and navigate to the App Graph section that visualizes the communication between the client and server applications.

7. Clean Up

Press CTRL+C in the terminal that runs diagrid dev run to stop the application and disconnect from Catalyst Cloud.

To delete the entire project and all provisioned resources:

diagrid project delete invocation-quickstart

Summary

In this quickstart you:

  • Logged in to Catalyst and provisioned a managed service invocation project with a single CLI command (diagrid dev run).
  • Invoked a remote server method from a client application using the Dapr Service Invocation API.
  • Verified service-to-service communication through application logs and the Catalyst web console.

Catalyst handled service discovery, routing, and secure communication automatically — no infrastructure to manage.

Next steps