You can configure product events and lifecycle events to be delivered directly to your remote backend. Specify remote endpoints in your app’s manifest and Forge will automatically route events along with a Forge Invocation Token and an optional app access token.
Given the high-volume nature of Forge events, remote invocations will have a timeout of 5 seconds. Your app needs to implement processing logic in an asynchronous fashion (for example, enqueuing events for a worker to process asynchronously). The diagram below illustrates such a solution.
To configure events to be delivered to your remote backend, in your manifest.yml
:
endpoint
your app will send remote requests to. This is done using the endpoint
property of the trigger
module defined for the event. Using endpoint
rather than function
tells Forge that your app will invoke your remote endpoint.endpoint
item with a key
matching the endpoint
name you specified in the previous step.
remote
property to the key that uniquely identifies the remote system the endpoint will communicate with.route.path
to the REST API operation path to be appended to the remote’s baseUrl, to invoke the desired REST API.auth
property.remotes
item with a key matching the remote name you specified in the endpoint, setting the baseUrl to the site URL prefix to prepend to the routes specified in your app's route.path.Here’s an example manifest.yml
of a module that routes an event to /frc-event
when a Confluence comment is added:
1 2modules: trigger: - key: remote-comment-trigger-boot endpoint: remote-events-boot events: - avi:confluence:created:comment endpoint: - key: remote-events-node remote: remote-app-node route: path: /frc-event auth: appSystemToken: enabled: true permissions: scopes: - read:app-system-token - read:confluence-content.summary remotes: - key: remote-app-node baseUrl: https://forge-remote-refapp-nodejs.services.atlassian.com
You will need to verify the requests received by your remote came from Atlassian and are intended for your app. For more information on how to do this, see Verifying remote requests.
If the remote endpoint returns a non-2xx response or if the invocation times out when delivering an event to a remote endpoint (the timeout period for an event invocation is 5 seconds), redelivery will be attempted as described by the note regarding retryOptions
below.
Information on the retry attempt will be provided in the retryContext
property sent in the HTTP request body. For example:
1 2{ "payload": { ... "retryContext": { "retryData": null, "retryCount": 2, "retryReason": "INVALID_REMOTE_INVOCATION_ERROR" } ... } }
See the developer documentation for retrying product events for more information.
retryOptions
cannot be set from remote invocations. By default:
retryData
will always be null
.retryReason
can be the following:
INVALID_REMOTE_INVOCATION_ERROR
General error. For example; the response from the remote server was non 2XX, the response did not follow the API contract defined in the Forge Remote Preview documentation or there was a network error.TIMEOUT_ERROR
The request timed out.INVALID_FORGE_INVOCATION_TOKEN
The invocation token could not be validated and the remote server responds with a 401.To see all the events that can be sent (including required scopes), see the events for each product:
To see what events your Forge app can subscribe to, see Lifecycle events.
Now that you’ve verified the requests and have received your access tokens, you can:
Rate this page: