> For the complete documentation index, see [llms.txt](https://docs.appfarm.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.appfarm.io/library/action-nodes/run-service.md).

# Run service

The Run service action node calls a service [endpoint](https://docs.appfarm.io/reference/services/service-endpoints.md) from within an [app](https://docs.appfarm.io/reference/apps.md) or from another [service](https://docs.appfarm.io/reference/services.md).

{% hint style="info" %}
Showroom: [Run Service example](https://showroom.appfarm.app/action-nodes/run-service-with-service-account), with its setup in Appfarm Create ([register](https://showroom.appfarm.app/sign-up) for access).
{% endhint %}

{% hint style="warning" %}
**Services are only available in solutions that already use them**

In apps, Run service is only offered in solutions that have Services. New solutions use [Flows](https://docs.appfarm.io/reference/flows.md) and the [Run flow](https://docs.appfarm.io/library/action-nodes/run-flow.md) action node instead.
{% endhint %}

## Usage

This action node is useful in the following cases:

* When logic should be shared across apps within a solution. The logic can be maintained in services and called from any app using Run service.
* When a service requires another service to run, for example if an access token for an external API needs to be refreshed.
* When it is not desirable to grant certain object class permissions to a client user but they need the ability to trigger a modification in the database. Using the **Run as** property, the service can be called by the selected [service account](https://docs.appfarm.io/reference/security/service-accounts.md) and will then run under the permissions granted to that account. A reference to the client user can be included in the call to make a change in the context of that user. The client user must have a role with the [permission](https://docs.appfarm.io/reference/security/permissions.md) **Act as Service Account** > `SERVICE_ACCOUNT`.
* If you are utilizing **Run service** from an [Unauthenticated App](https://docs.appfarm.io/how-to/authentication-and-access-control/unauthenticated-access.md), you need to apply the Service Security setting [Unauthenticated Access](https://docs.appfarm.io/reference/configuration/environments.md#service-security).

{% hint style="info" %}
**Good to know**

Run service calls the endpoint with the method you select under **Method**. You can set or bind values for the endpoint's query parameters, but the node does not send a request body. If you need to post data to a service, you should instead configure a [web request](https://docs.appfarm.io/library/action-nodes/web-request.md) that points to the endpoint URL.
{% endhint %}

## Properties

<table><thead><tr><th width="239">Property</th><th>Description</th></tr></thead><tbody><tr><td><strong>Service</strong></td><td>Select the <a href="https://docs.appfarm.io/reference/services.md">service</a> containing the endpoint the action node will call.</td></tr><tr><td><strong>Endpoint</strong></td><td>Select the <a href="https://docs.appfarm.io/reference/services/service-endpoints.md">endpoint</a> the action node will call.</td></tr><tr><td><strong>Method</strong></td><td>The HTTP method to call the endpoint with. The options are the methods the endpoint allows.</td></tr><tr><td><strong>Run as</strong></td><td><em>Not available when Run service is used inside a service.</em><br><br>Select a <a href="https://docs.appfarm.io/reference/security/service-accounts.md">service account</a> to run the service on behalf of the user. The <a href="https://docs.appfarm.io/reference/security/users.md">user</a> triggering the action must have the necessary <a href="https://docs.appfarm.io/appcademy/appfarm-fundamentals/user-handling-and-permissions/permissions.md">permissions</a> to act as the service account and the service account must have the permissions to run the service and access and manipulate the relevant data.</td></tr><tr><td><strong>Use app time zone</strong></td><td>Call the endpoint using the app's time zone and override the default time zone set under <a href="https://docs.appfarm.io/reference/services/service-settings.md">Service settings</a>.</td></tr><tr><td><strong>Parameters</strong></td><td><em>Available if the endpoint has query parameters.</em><br><br>Set values for any query parameters.</td></tr><tr><td><strong>Result mapping</strong></td><td><em>Available if the endpoint returns data sources.</em><br><br>Map the data sources returned by the endpoint to data sources in the app or service.</td></tr></tbody></table>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.appfarm.io/library/action-nodes/run-service.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
