Create Actions.xml


To integrate your Android app with App Actions, you must have an actions.xml file placed in your app project's res/xml directory.

Add a reference to the actions.xml file in the AndroidManifest.xml file using a <meta-data> tag as follows:

    <!-- ... -->
    <meta-data android:name="" android:resource="@xml/actions" />

This declares an XML resource for the xml/actions.xml file in the APK. To learn more about specifying resources in Android, see the App resources overview in the Android developer documentation.


The following table describes the schema for actions.xml. All attributes are required unless marked "optional".

Tag Contained in Attributes
<actions> top-level
<action> <actions> intentName
<parameter> <action> name
<entity-set-reference> <parameter> entitySetId
<fulfillment> <action> urlTemplate

fulfillmentMode (optional)

<parameter-mapping> <fulfillment> urlParameter


required (optional)

entityMatchRequired (optional)

<entity-set> <actions> entitySetId
<entity> <entity-set> { name, alternateName (optional) } OR { sameAs }

{ identifier } OR { url }



An App Action that the app supports.


  • intentName: Built-in intent for the App Action (for example, "actions.intent.CREATE_TAXI_RESERVATION"). For a list of built-in intents we support for deep linking into your app or launching your custom slices, see Implement built-in intents for App Actions.


A parameter of an App Action having a name and list of associated entities.


  • name: Name to associate with this parameter (for example, "destination"). The name should be a leaf-level field of the parameter (for example, If the parameter is a primitive type, such as a string, then the name is just the parameter name itself.


Reference to a feed that the developer supplies. Feeds must be provided directly in the actions.xml file using <entity-set> tags.


  • entitySetId: A reference to a specific collection of entities. This should correspond to an entitySetId in an <entity-set> tag.


Information about how to fulfill the user intent using the Android app. Developers may provide multiple <fulfillment> elements in actions.xml, with different set of required parameters for each intent. Google uses the first <fulfillment> for which all required parameters are available to fulfill the user's query.

You must provide one <fulfillment> without any required parameters as a fallback fulfillment.


  • urlTemplate: Template for constructing either the deep link or a Slice URI to be opened on the device. The template may be expanded with the parameters of the user intent if all required parameters for the template are available. For examples of the HTTP URL template, see the Wikipedia article on URL templates. The template format follows the RFC6570 URI template specification.
  • fulfillmentMode: (optional) Fulfillment mode used for serving. The valid values are:
    • "actions.fulfillment.DEEPLINK" - Fulfill user action by opening the Android app using a deep link. This is the default.
    • "actions.fulfillment.SLICE" - Fulfill user action by embedding a Slice provided by Android app.

The following are some examples of URL template values:

Template Values Expanded value{?foo,bar} "foo": "123"

"bar": "456"{&foo,bar} "foo": "123"

"bar": "456"{#foo} "foo": "123"
myapp://example/{foo} "foo": "123" myapp://example/123
intent://foo#Intent;scheme=my-scheme{;S.extra1,S.extra2};end "S.extra1": "123"

"S.extra2": "456"


For more about configuring URL templates, see Fulfillment with URL templates.


Maps from variables in the URL template to intent parameters. Keys in this map represent URL template parameters, or "variables" as decribed in RFC 6570.

If a parameter is not included in the intent, the corresponding variable will be left undefined at the time of URL template expansion. See RFC 6570, Section 3.2.1 for a description of how undefined variables are treated.

Note that required="true" and entityMatchRequired="true" are distinct.


  • urlParameter: Every variable mentioned in the URL template must have a corresponding urlParameter in <parameter-mapping>. For example, if the uri_template is "{?lat,long}", there must be a key in <parameter-mapping> for parameters "lat" and "long".
  • intentParameter: Values refer to intent parameters. If the intent parameter is of a structured type, use dot.notation to refer to a nested field. For example, if there is a parameter "taxiReservation" of type, you can use taxiReservation.pickupLocation.geo.latitude to refer to the latitude value.

    If providing an entity set for this parameter, the intentParameter must match exactly the name of the corresponding <parameter> tag (for example, taxiReservation.pickupLocation.geo.latitude). It should point to a leaf-level field of the parameter (if the intent parameter has a complex type) or the parameter name itself (if the intent parameter has a primitive type).

  • required: (optional) Indicates that a value for the given intentParameter is required to be present for this URL template to be valid. The URL template is dropped if the user query does not include a value for the given intentParameter.

  • entityMatchRequired: (optional) Indicates that the given urlParameter will only be included in the URL template if there is an inventory match for the intentParameter.

    If not specified, Google assumes that an inventory match is optional. That is, if inventory match does happen, the identifier from the matched inventory entity is passed to the URL template. If inventory match does not happen, the built-in intent parameter value (text) is omitted from the URL template.


Set of inlined entities in actions.xml.


  • entitySetId: Required unique identifier for an <entity-set>in actions.xml (for example, "myInlineEntitySet1"). This value should correspond to the <entitySetId> value in the <entity-set-reference> tag.


One element among a set of entities inlined in actions.xml. Contains a subset of fields.

String values for the url, identifier, and sameAs fields can either be hard-coded or referenced via the APK's string resources. In order to provide synonyms, string values for the alternateName field can be referenced via the APK's string array resources.


  • name: Required name for the entity, unless you are specifying a sameAs field. Must be unique across entity name and alternativeName fields for the given <entity-set> (for example, "toothpaste").
  • alternateName: (optional) Alternate names for the entity. You must specify a name field before specifying an alternateName field. Must be unique across entity name and alternativeName fields for the given <entity-set>. The entity is selected if the user's query matches any of these strings.
  • sameAs: URL of a reference web page that unambiguously identifies the entity. Used to specify an enum value if and only if the intent parameter type is a subtype of

    Required for parameter fields whose types are subtypes of (for example: MealTypeBreakfast).

  • identifier: Identifier for the entity. Must be unique across entities for the given <entity-set> (for example, "CAPPUCCINO_ID").

  • url: RFC 3986 URL to be opened on an Android device. The URL may or may not be resolvable by an HTTP client. For example, on Android, the URL may be an app-linked "http://" URL or a device-specific URL, such as an "intent://" URL or a URL in a custom URL scheme.

    Either identifier or url must be provided. Also, all entities within a given entity set must have the same field (identifier or url) provided.

    You can the url field together with the urlTemplate in <fulfillment> in the following ways:

    • Provide URLs in the inline inventory and omit the URL template.
    • Provide a URL template and omit URLs in the inline inventory (provide identifiers instead).
    • Provide URLs in in the inline inventory, and use them in the URL template (for example, "{@url}&extra_param=foo").

Inline inventory for App Actions

You can optionally add inline inventory for your app through <entity> tags in your actions.xml file. This lets you provide identifiers that your app understands for entities in user queries. This simplifies your development because your app only needs to handle those identifiers from App Action invocations and does not have to recognize strings (or Google enum values).

If you specify inline inventory, you can use different URL templates for recognized and unrecognized parameter values. If you define a fulfillment URL template with parameter that has entityMatchRequired=true and required=true, Google will only use the template if there is an inline inventory match. This lets you fall back on a disambiguation or search activity if there is not an exact match.

You can specify up to 1,000 entities per app, across all entity sets.

Fulfillment with URL templates

For every <action> tag in your actions.xml file, you must provide a fulfillment mechanism. In the URL template model, you declare a URL template with placeholders for dynamic parameters. This template maps to one of your own Android activities, using an App Links URL, a custom scheme, or an Intent-based URL.

For example, for a ride hailing service, you can declare a URL template where Google would embed the origin and destination coordinates for a taxi ride.

Configuring the URL template

Example of an App Links URL:

<action intentName="actions.intent.CREATE_TAXI_RESERVATION">
    <fulfillment urlTemplate="{?dropoffLocation}">

Example of a custom scheme:

<action intentName="actions.intent.CREATE_TAXI_RESERVATION">
    <fulfillment urlTemplate="mytaxi://reserve{?dropoffLocation}">

Example of an Intent-based URL:

<action intentName="actions.intent.CREATE_TAXI_RESERVATION">

The intentName attribute defines the App Action built-in intent.

The urlTemplate attribute contains the URL that will be called to trigger your Activity. Each urlTemplate you define can have any (or none) of the built-in intent parameters for each App Action.

The intentParameter attribute specifies which value (as provided by the user) you want substituted into your URL. In our example, we asked for the drop off location name (""). For the built-in parameters, the possible values are provided in the built-in intent reference .

The urlParameter attribute is the name of the parameter in the URL that will be substituted. This value must be present in your urlTemplate and inside curly braces {}.

If you are specifying entity sets, you can combine the URL from an entity set with other URL parameters. This is accomplished by providing a <urlTemplate> that begins with an "{@url}" placeholder, such as "{@url}&autoplay=true&utm_source=assistant".

App Links URLs

If you are using an App Links URL, the urlTemplate points to a regular http URL that can trigger your Activity. Parameters are passed as URL parameters to the App Links URL. The parameters in urlTemplate needs to be enclosed in curly braces with a question mark (?) prefix. If the parameter is not set, the entire curly braces will be omitted.

As an example, if a user triggered the App Action by asking to order a taxi to "San Francisco", the final Uri that is triggered (after parameter substitution) would be:

Intent-based URLs

If you are using an intent-based URL, the urlTemplate value includes the package name, the Intent action, and one Intent extra, called the "dropoff". The extra is prefixed by "S." to denote a String Intent extra (as defined by Intent.toUri()) and is surrounded by curly braces {} to denote a substitution by a parameter. The extra preceding semicolon is needed to separate the Intent action from the Intent extra (and will only be included if the parameter is set).

In our example, the urlParameter value is set to "S.dropoff"; you can see where this will appear in our URL by looking for this value in urlTemplate.

As an example, if a user triggered our Action by asking to order a ride to "San Francisco", the final Uri that is triggered (after parameter substitution) would be:


Using URL values from entities in URL templates

By default, if an entity is matched to the user's query, the identifier value is passed to the URL template. In order to reference the url field of an entity instead, do not create a <parameter-mapping> for the parameter. Instead, add "{@url}" to the URL template. Note that while identifier values are URL-escaped, url values are left unchanged.

For example:

<fulfillment urlTemplate="{@url}">
    <!-- No parameter-mapping is needed -->
<entity-set entitySetId="...">
    <entity name="..." url="https://my.url.fulfillment/1"/>
    <entity name="..." url="https://my.url.fulfillment/2"/>

The {@url} parameters can be combined with other parameters. For example:

<fulfillment urlTemplate="{@url}?referrer=actions_on_google{&amp;other_param}">
    <parameter-mapping intentParameter="" urlParameter="other_param"/>
<entity-set entitySetId="...">
    <entity name="..." url="https://my.url.fulfillment/1"/>
    <entity name="..." url="https://my.url.fulfillment/2"/>

Parameter matching

The way Google matches parameters from the user utterances to the entities you specified depends on the type of the parameter:

  • Enum: Google matches the user's query ("monday") to an associated enum URL (""), then picks the entity whose sameAs value matches the enum URL.
  • String: Google picks the entity whose name or alternateName value matches the user's query.


Finance - accounts and payments

The following actions.xml example uses the actions.intent.CREATE_MONEY_TRANSFER built-in intent:

<?xml version="1.0" encoding="utf-8"?>
    <action intentName="actions.intent.CREATE_MONEY_TRANSFER">
        <fulfillment urlTemplate="mybankapp://transfer{?amount,currency,recipientBankAccountType,senderBankAccountType,mode}">
            <parameter-mapping intentParameter="moneyTransfer.amount.value" urlParameter="amount" />
            <parameter-mapping intentParameter="moneyTransfer.amount.currency" urlParameter="currency" />
            <parameter-mapping intentParameter="" urlParameter="recipientBankAccountType" />
            <parameter-mapping intentParameter="" urlParameter="senderBankAccountType" />
            <parameter-mapping intentParameter="moneyTransfer.transferMode" urlParameter="mode" />

Fitness - nutrition

The following actions.xml example uses the actions.intent.RECORD_FOOD_OBSERVATION built-in intent:

<?xml version="1.0" encoding="utf-8"?>
    <action intentName="actions.intent.RECORD_FOOD_OBSERVATION">
        <parameter name="foodObservation.forMeal">
            <entity-set-reference entitySetId="MealEntitySet"/>
        <fulfillment urlTemplate="myfoodapp://record{?food,meal}">
            <parameter-mapping intentParameter="foodObservation.forMeal" urlParameter="meal" entityMatchRequired="true" />
            <parameter-mapping intentParameter="" urlParameter="food" />
    <entity-set entitySetId="MealEntitySet">
        <entity sameAs="" identifier="1" />
        <entity sameAs="" identifier="2" />
        <entity sameAs="" identifier="3" />


Food ordering

The following actions.xml example uses the actions.intent.ORDER_MENU_ITEM built-in intent:

<?xml version="1.0" encoding="utf-8"?>
    <action intentName="actions.intent.ORDER_MENU_ITEM">
        <parameter name="menuItem.inMenuSection.inMenu.forRestaurant.servesCuisine">
            <entity-set-reference entitySetId="CuisineEntitySet"/>
        <fulfillment urlTemplate="myfoodapp://order{?restaurant}">
            <parameter-mapping intentParameter="" urlParameter="restaurant" required="true" />
        <!-- URL values are derived from a matched entity from the CuisineEntity Set. This is not a fallback fulfillment because {@url} is a required parameter. -->
        <fulfillment urlTemplate="{@url}" />
        <!-- Fallback fulfillment with no required parameters -->
        <fulfillment urlTemplate="myfoodapp://browse{?food}">
            <parameter-mapping intentParameter="" urlParameter="food" />
    <entity-set entitySetId="CuisineEntitySet">
        <entity url="myfoodapp://browse/italian/pizza" name="@string/pizza" alternateName="@array/pizzaSynonyms" />
        <entity url="myfoodapp://browse/american/hamburger" name="@string/hamburger" alternateName="@array/hamburgerSynonyms" />
        <entity url="myfoodapp://browse/mediterranean" name="@string/mediterranean" alternateName="@array/mediterraneanSynonyms" />


The following actions.xml file uses the actions.intent.CREATE_TAXI_RESERVATION built-in intent:

    <action intentName="actions.intent.CREATE_TAXI_RESERVATION">
        <fulfillment urlTemplate="{?dropoffAddress}">
            <!-- Dropoff location as an address -->


The following actions.xml example uses the actions.intent.OPEN_APP_FEATURE built-in intent.

<?xml version="1.0" encoding="utf-8"?>
    <action intentName="actions.intent.OPEN_APP_FEATURE">
        <!-- Each parameter can reference an entity set using a custom ID. -->
        <parameter name="feature">
            <entity-set-reference entitySetId="FeatureEntitySet"/>

        <fulfillment urlTemplate="myexampleapp://pathto{?appFeature}">
            <parameter-mapping intentParameter="feature" urlParameter="appFeature" />

    <entity-set entitySetId="FeatureEntitySet">
        <entity identifier="FEATUREONE" name="first feature" />
        <entity identifier="FEATURETWO" name="second feature" />