This page explains implementation approaches for different purposes, such as authentication, continuous data reception, and streaming. See the Blueprint API Reference for details about each pin.
gRPC has four communication methods. Choose one from the table below according to your purpose. Server Streaming, Client Streaming, and Bidi Streaming are available only in the Full Edition.
| Purpose | Communication method | Available in |
|---|---|---|
| Send once and receive once | Unary | Free / Full Edition |
| Send once and receive multiple times | Server Streaming | Full Edition only |
| Send multiple times and receive the result once at the end | Client Streaming | Full Edition only |
| Send and receive continuously at the same time | Bidi Streaming | Full Edition only |
On the sample server, you can try each method with the following Methods. Set Service on the Call node to UserService and choose the Method from Method Name in Details.
| Method | Data sent | Data received | Communication method |
|---|---|---|---|
Login | LoginRequest | LoginResponse | Unary |
WatchUsers | LoginRequest | UserInfo | Server Streaming |
UploadUsers | LoginRequest multiple times | UploadUsersResponse | Client Streaming |
UserLookup | LoginRequest multiple times | UserInfo multiple times | Bidi Streaming |
Authenticate with an access token
- Create a Channel that uses TLS.
- Call the login Method with
Call gRPC Unary. - Save the received access token to a variable.
- For later calls, set the saved value in
Access Tokenin the Call Options. - When the token expires, log in again.
If you want to use the same token for every call on a Channel, you can also set it in the Channel Config’s Access Token. If a value is set in the individual Call Options, that value takes precedence.
Image coming soon: Using a per-call token after Login
Image replacement marker
A Blueprint that saves the Session Token from the Login Response, passes it to Access Token in Make OmniGrpc Call Options, and calls GetUser. Mask the actual token value.
- Recommended filename
images/OmniGRPC/usecase-auth-token.png- Alt text
- Blueprint that passes a Bearer token obtained at login to later gRPC calls
Run a Unary RPC
Use Unary for operations that send data once and receive the result once, such as logging in, getting user information, or saving settings.
- Node to use:
Call gRPC Unary - Data to send:
Request - On success: receive
ResponsefromOn Success - On failure: receive
StatusfromOn Error - Stop early: call
Cancelon the Action returned by the node
If you connect to the same server, reuse the Channel. If you close a screen and no longer need the result, or if you search again with different conditions, Cancel the old call before starting a new one.
Receive data continuously with Server Streaming
Full Edition onlyUse Server Streaming when the server sends data multiple times in response to a single Request, such as ranking lists, progress updates, monitoring data, or text that an AI is generating.
- Send a Request with
Call gRPC Server Streaming. - Update the UI or local state each time
On Message Receivedfires. - Confirm normal completion with
On Completed. - Handle errors with
On Error. - To close the screen, call
Cancelon theActionsaved to a variable when the call started.
The game keeps running while On Message Received is being handled. Very heavy processing on every message can make the screen stutter, so split image processing and large calculations into smaller chunks.
The sample WatchUsers receives three records (alice, bob, and carol) and then completes normally.
sequenceDiagram
accTitle: Receiving and ending a Server Streaming call
participant BP as Blueprint
participant Server as gRPC Server
BP->>Server: Send one Request
loop Each time data arrives
Server-->>BP: On Message Received
end
alt Normal completion
Server-->>BP: On Completed
else Error
Server-->>BP: On Error
end
Image coming soon: WatchUsers Server Streaming
Image replacement marker
A Blueprint that appends UserInfo to an array in On Message Received for Call gRPC Stream: WatchUsers and handles On Completed and On Error separately. Connect a Cancel button to action.Cancel.
- Recommended filename
images/OmniGRPC/usecase-server-streaming.png- Alt text
- Blueprint that receives multiple user records with Server Streaming
Send multiple records with Client Streaming
Full Edition onlyUse Client Streaming when you send data repeatedly and receive the result once at the end, such as registering multiple records or uploading a file in chunks.
- Start
Call gRPC Client Streamingand save theActionoutput fromThento a variable. - Call
Send Messageon the Action each time you send data. - After sending everything, always call
Close Send. - Receive the server’s result with
On Message Received. - Finish with
On CompletedorOn Error.
Close Send tells the server that the client has finished sending. If you do not call it, the server may keep waiting for more data and never return a result. After Close Send, you cannot send new data.
sequenceDiagram
accTitle: Sending and ending a Client Streaming call
participant BP as Blueprint
participant Action as Saved Action
participant Server as gRPC Server
BP->>Action: Save to a variable from the Call node's Then
loop For each item
BP->>Action: Send Message (LoginRequest)
Action->>Server: Request
end
BP->>Action: Close Send
Action->>Server: Notify that sending is complete
Server-->>BP: On Message Received (UploadUsersResponse)
Server-->>BP: On Completed
The diagram shows the normal completion path. If Send Message returns false, the message was not accepted. Handle errors with On Error, and if the call is no longer needed, such as when the screen closes, Cancel the Action.
If you send alice and bob to the sample UploadUsers and then call Close Send, you receive Accepted Count = 2 and Summary = uploaded 2 users: alice,bob.
Image coming soon: UploadUsers Client Streaming
Image replacement marker
A Blueprint that saves the start action to a variable, sends LoginRequest with Send Message in a ForEach loop, calls Close Send on Completed, and then handles UploadUsersResponse in On Message Received.
- Recommended filename
images/OmniGRPC/usecase-client-streaming.png- Alt text
- Blueprint that sends multiple requests with Client Streaming and receives the final response
Communicate in both directions with Bidi Streaming
Full Edition onlyUse Bidi Streaming when you need to send and receive at the same time, such as chat, collaborative editing, or remote control.
- Start
Call gRPC Bidi Streamingand save theActionoutput fromThento a variable. - Call
Send Messagewhen needed. - Handle
On Message Receivedindependently of how many messages you send. - Call
Close Sendwhen you are done sending. - Call
Cancelto abort the session itself.
Sending and receiving happen independently. A message you send does not necessarily produce exactly one result next. If you need to match results to specific sends, ask the server team to include an ID in the server-side specification.
Handle normal completion with On Completed and errors with On Error. Receiving continues after Close Send, so keep the Action until you receive one of the end events.
The sample UserLookup returns one UserInfo for each Username sent. For alice, the result is User Id = u-alice and Display Name = alice.
Differences between ending a send, cancelling a call, and closing a connection
| Operation | Target | State afterward |
|---|---|---|
Close Send | Client or Bidi Action | No more sends. Wait for received data and the end event |
Cancel | The running Action | Requests that the entire RPC be aborted. When successful, usually Cancelled in On Error |
Close Channel | Channel | New RPCs cannot start. RPCs already in progress are not cancelled automatically |
If you will keep communicating with the same destination, keep the Channel. When closing a screen or the game, Cancel any unneeded Actions before closing the Channel.
Image coming soon: UserLookup Bidi Streaming
Image replacement marker
A Blueprint that keeps the Bidi action in a variable, sends from UI input with Send Message, displays UserInfo in an independent On Message Received, and calls Close Send from an end button.
- Recommended filename
images/OmniGRPC/usecase-bidi-streaming.png- Alt text
- Blueprint that sends requests and receives responses in parallel with Bidi Streaming
Check server availability
Combine the following features for connection waits on loading screens or for displaying online status.
Get Channel State: check the current connection state immediatelyWait for gRPC Channel Connected: wait for a specified time until a connection is possibleCheck gRPC Health: Full Edition only check whether the server can actually process requests
Only Check gRPC Health is a Full Edition feature. Get Channel State and Wait for gRPC Channel Connected are also available in the Free Edition.
Even when the Channel State is Ready, the Service you want may be down. If you need a reliable “online” indicator, check for a successful Health Check as well.
Branch on the Success output of On Connected for Wait for gRPC Channel Connected. When the connection fails, On Connected(false) is called in addition to On Timeout. The API Reference has a table of event behavior.
Retry communication automatically
To retry automatically when the server is temporarily unreachable, configure the Retry Policy in the Channel Config.
MaxAttempts: maximum number of attempts, including the first oneInitialBackoff/MaxBackoff: minimum and maximum wait time before retriesBackoffMultiplier: factor that increases the wait time as failures continueRetryableStatusCodes: error types that should be retried automaticallyRetryPolicyServiceName: the fully qualified Service name including the package
For calls where duplicate execution is a problem, such as payments, purchase confirmation, or item grants, check the server-side specification before enabling automatic retries.
Connect to an AI inference service
- Send one image and receive the result: Unary (Free / Full Edition)
- Receive generated text incrementally: Server Streaming (Full Edition only)
- Send audio in chunks and receive the full text at the end: Client Streaming (Full Edition only)
- Voice conversation or interactive sessions: Bidi Streaming (Full Edition only)
If the data is large, such as images or audio, check MaxSendMessageBytes / MaxReceiveMessageBytes and configure compression if needed. Match the values to the server-side settings.
Connect from an Android or iOS device
Full Edition onlyAndroid and iOS support is available only in the Full Edition. In the Full Edition, you can use the same Service Assets and Blueprints as on PC. The additional checks for Android and iOS are the destination, network permissions, certificates, and other settings.
On a device, 127.0.0.1 refers to the device itself, not your development PC. To connect to a development server on the LAN, use the PC’s IP address or DNS name that the device can reach.
Use TLS in apps you publish. Connections may also drop when switching between Wi-Fi and mobile networks, or when the app returns from the background. Check the Channel State and show a reconnecting indicator when necessary.