> For the complete documentation index, see [llms.txt](https://developers.make.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers.make.com/custom-apps-documentation/app-components/rpcs.md).

# Remote Procedure Calls

Remote Procedure Calls are used to retrieve live data from a service for an input field.

You can use RPCs to retrieve dynamic options in a field to clarify the expected input for a user. For example, selecting a country in a dropdown could trigger an RPC to retrieve corresponding states or cities.

These requests are invoked while the user interacts with the modules when building a scenario.

## Types of RPCs

* [Dynamic fields RPCs](/custom-apps-documentation/app-components/rpcs/dynamic-fields-rpc.md) generate dynamic fields inside a module.
* [Dynamic options RPCs](/custom-apps-documentation/app-components/rpcs/dynamic-options-rpc.md) dynamically fill the fields in a module.
* [Dynamic sample RPCs](/custom-apps-documentation/app-components/rpcs/dynamic-sample-rpc.md) replace hard-coded samples that might become outdated quickly.

## Components

### Connection

Every RPC must have the same connection that is used by the modules calling the RPC.

{% hint style="warning" %}
If a module with a connection references an RPC that has no connection attached (or a different one), the module fails to open with the error "Provided connection is not acceptable for this RPC."

This applies to **all** RPCs referenced by the module, including [request-less](/custom-apps-documentation/component-blocks/api/request-less-communication.md) RPCs that only return static fields and never call the API.
{% endhint %}

If a module offers multiple connections, the RPCs it references must declare the same connection list.

### Communication

Communication can be [request-less](/custom-apps-documentation/component-blocks/api/request-less-communication.md).

As with modules, you can use [pagination](/custom-apps-documentation/component-blocks/api/pagination.md) in RPCs to iterate the records.

### Parameters

[Parameters](/custom-apps-documentation/block-elements/parameters.md) from the modules are passed automatically to linked RPCs.

## Available IML variables

The following IML variables are available to use anywhere in a module within IML strings.

<table><thead><tr><th width="236.22216796875" valign="top">Variable</th><th valign="top">Description</th></tr></thead><tbody><tr><td valign="top"><code>now</code></td><td valign="top">Current date and time with milliseconds in UTC timezone, in ISO 8601 format: <code>YYYY-MM-DDTHH:mm:ss.sssZ</code>.</td></tr><tr><td valign="top"><code>environment</code></td><td valign="top">TBD</td></tr><tr><td valign="top"><code>temp</code></td><td valign="top">Contains custom variables created using the <code>temp</code> directive.<br>Example:<br><code>"temp": {</code><br><code>"id": 123</code><br><code>},</code><br><code>"url": "/user/{{temp.id}}" // url === "/user/123"</code></td></tr><tr><td valign="top"><code>parameters</code></td><td valign="top">The module's input parameters collection (<a href="/pages/8LRxDGHGwDiNv5R8x775">static</a> and <a href="/pages/YqHnVxdqiDXHJXnpnuZp">mappable</a>).. The keys are the parameter `name` values, and the values are the data mapped by the user.</td></tr><tr><td valign="top"><code>connection</code></td><td valign="top">The connection data collection (access token or API key and other values).</td></tr><tr><td valign="top"><code>common</code></td><td valign="top">The collection defined in the app's <a href="/pages/7f7WBg4lQb6jlpM7paLb#common-data">Base common data</a>. This will typically include the module 'timeout' limit and Client ID and secret when using <a href="/pages/jeQ081ucsJ3fhXoz9ybG">OAuth 2.0</a> code grant connections.</td></tr><tr><td valign="top"><code>data</code></td><td valign="top">The module's data collection.</td></tr><tr><td valign="top"><code>scenario</code></td><td valign="top">TBD</td></tr><tr><td valign="top"><code>metadata.expect</code></td><td valign="top">The module's raw <a href="/pages/YqHnVxdqiDXHJXnpnuZp">mappable parameters</a> as they were specified in the configuration.</td></tr><tr><td valign="top"><code>metadata.interface</code></td><td valign="top">The module’s raw <a href="/pages/1y6qqVVjHMYRhKtL0Qgk">interface</a> array the way you have specified it in the configuration.</td></tr></tbody></table>

Additional variables available within the `response` collection:

<table><thead><tr><th width="143.629638671875" valign="top">Variable</th><th valign="top">Description</th></tr></thead><tbody><tr><td valign="top"><code>output</code></td><td valign="top">When using the <a href="/pages/ku0zthyPAwJhsYGdbnz2">wrapper directive</a>, the 'output' variable represents the result of the output directive.</td></tr></tbody></table>

Additional variables available when using the `iterate` directive, for example within the wrapper or [pagination](/custom-apps-documentation/component-blocks/api/pagination.md) collections:

<table><thead><tr><th width="238.44439697265625" valign="top">Variable</th><th valign="top">Description</th></tr></thead><tbody><tr><td valign="top"><code>iterate.container.first</code></td><td valign="top">The first item of the iterated array.</td></tr><tr><td valign="top"><code>iterate.container.last</code></td><td valign="top">The last item of the iterated array.</td></tr></tbody></table>

Additional variables available within the [pagination](/custom-apps-documentation/component-blocks/api/pagination.md) and [response](/custom-apps-documentation/component-blocks/api/handling-responses.md) collections:

<table><thead><tr><th width="157.70367431640625" valign="top">Variable</th><th valign="top">Description</th></tr></thead><tbody><tr><td valign="top"><code>body</code></td><td valign="top">The response body received from the last request.</td></tr><tr><td valign="top"><code>headers</code></td><td valign="top">The response headers received from the last request.</td></tr><tr><td valign="top"><code>item</code></td><td valign="top">When using the <code>iterative</code> directive, this variable represents the current item that is being iterated.</td></tr></tbody></table>

Additional variables available in the webhook [attach](/custom-apps-documentation/app-components/webhooks/dedicated/attached.md) RPC.

<table><thead><tr><th width="164.74078369140625" valign="top">Variable</th><th valign="top">Description</th></tr></thead><tbody><tr><td valign="top"><code>webhook.id</code></td><td valign="top">Internal webhook ID.</td></tr><tr><td valign="top"><code>webhook.url</code></td><td valign="top">The webhook URL that you can use to automatically register the webhook in the external platform via the API, when it's supported.</td></tr></tbody></table>

Additional variables available in the webhook [detach](/custom-apps-documentation/app-components/webhooks/dedicated/not-attached.md) RPC and in the `expect` [mappable parameter](/custom-apps-documentation/component-blocks/mappable-parameters.md) and the [interface](/custom-apps-documentation/component-blocks/interface.md) section of an instant trigger module.

<table><thead><tr><th width="153.62957763671875" valign="top">Variable</th><th valign="top">Description</th></tr></thead><tbody><tr><td valign="top"><code>webhook</code></td><td valign="top">The webhook’s data collection.</td></tr></tbody></table>

## Limits

<table><thead><tr><th valign="top">Name</th><th valign="top">Total limit of...</th><th valign="top">Value</th></tr></thead><tbody><tr><td valign="top">Max Execution Timeout</td><td valign="top">... seconds</td><td valign="top">40</td></tr></tbody></table>

<table><thead><tr><th width="173.33333333333331" valign="top">Name</th><th width="234" valign="top">Recommended limit of ...</th><th valign="top">Value</th></tr></thead><tbody><tr><td valign="top">Request Count</td><td valign="top">... calls performed by RPC</td><td valign="top">3</td></tr><tr><td valign="top">Record Count</td><td valign="top">... paginated records</td><td valign="top">3 * number of objects per page</td></tr></tbody></table>

## Best Practices

Review the [best practices for RPCs](/custom-apps-documentation/best-practices/remote-procedure-calls.md).


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://developers.make.com/custom-apps-documentation/app-components/rpcs.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
