AddOns Response Service

AddOns Response Service

This service allows scripts to configure and build Google Workspace add-ons that extend Google Workspace Studio.

Classes

NameBrief description
ActionAn action that Google Workspace add-ons that extend Google Workspace Studio can use to render anew card.
AddOnsResponseServiceAddOnsResponseService provides the ability to create responses for Google Workspaceadd-ons that extend Google Workspace Studio.
BasicDataTypeAn enum that represents the basic generic data types.
ColorA Color object which represents a color in the RGBA color space.
DataTypeA DataType is used to set the type of a variable.
DynamicResourceDefinitionA DynamicResourceDefinition is a building block for aResourceFieldsDefinitionRetrievedAction, it can contain one or more numbers ofResourceField to dynamically define the number of output variables provided by a step in GoogleWorkspace Studio.
ErrorActionabilityA Enum that represents the error actionability.
ErrorRetryabilityA Enum that represents the retry-ability of action invocation when having an error.
FontWeightAn enum that represents the font weight of the styled text.
HostAppActionA HostAppAction is a type of Action that is handled by individual host apps.
HyperlinkA Hyperlink element used inTextFormatElement.
InsertSectionA builder for InsertSection objects.
InsertWidgetA builder for InsertWidget objects.
LinkThe link object from a third-party resource which gets converted it to a smart chip in the hostapplication.
ListContainerContainer for list items, where each list item can contain multipleTextFormatElement.
ListItemA list item, where each list item can contain multipleTextFormatElement.
ListTypeAn enum that represents the type of the list.
ModifyCardA builder forModifyCard objects that changes and updates an existing card'sinterface by passing theModifyCard object to aAction.
NavigationA helper object that controls card navigation.
RemoveSectionA builder forRemoveSection objects.
RemoveWidgetA builder for RemoveWidget objects.
RenderActionRenders or updates a card by performing anAction in response to a user interaction.
RenderActionBuilderA builder forRenderAction objects.
ResourceDataRepresents a application specific resource data, a resource data contains a collection ofkey-value pairs of variable names andVariableData.
ResourceFieldA ResourceField is a basic building block of aDynamicResourceDefinition, each resourcefield corresponds to a output variable of the current step.
ResourceFieldsDefinitionRetrievedActionAResourceFieldsDefinitionRetrievedAction is a type ofResourceFieldsDefinitionRetrievedAction that isused to retrieve the definition of a list of resource fields through thedynamicResourceDefinitionProvider function specified in the manifest.
ResourceRetrievedActionA ResourceRetrievedAction is used to retrieve custom resource content when needed, where thecustom resource field is defined in the ResourceData.
ResourceTypeAn application specific resource type, the unique identifier of the resource type should have acorresponding WorkflowResourceDefinition.
ReturnElementErrorActionA ReturnElementErrorAction indicates that an error occurred during element invocation.
ReturnOutputVariablesActionContains output variables generated by the executed action in Google Workspace Studio.
SaveWorkflowActionThis action indicates that the host app (Google Workspace Studio) should save the agent.
StyledTextText element with styles such as bold, italic and color.
TextFormatChipA clickable chip in the text format.
TextFormatElementA text format element, which can be aTextFormatChip,StyledText,Hyperlink, orListContainer.
TextFormatIconAn icon that is displayed in aTextFormatChip.
TextStyleAn enum that represents the style of the styled text.
TimeStampRepresents a timestamp object which is can be added to aVariableData.
UpdateWidgetA builder forUpdateWidget objects.
ValidationErrorSeverityAn enum that represents the severity of the validation error.
ValueMetadataA valueMetadata contains information about the potential values of a variable.
VariableDataRepresents a variable data which can contain a collection of values in various types.
WorkflowActionA WorkflowAction is a type ofHostAppAction that is used to perform a specific action inGoogle Workspace Studio.
WorkflowTextFormatA block of text with rich formatting options including styles, hyperlinks, and interactiveelements defined inTextFormatElement.
WorkflowValidationErrorActionThis action indicates that the host app (Google Workspace Studio) should display a validationerror.

Action

Methods

MethodReturn typeBrief description
addModifyCard(modifyCard)ActionAdds a ModifyCard operation to the action.
addNavigation(navigation)ActionAdds a card navigation to the action.

AddOnsResponseService

Methods

MethodReturn typeBrief description
newAction()ActionCreates a newAction.
newNavigation()NavigationCreates a newNavigation.
newRenderActionBuilder()RenderActionBuilderCreates a newRenderActionBuilder.

BasicDataType

Properties

PropertyTypeDescription
BASIC_TYPE_UNSPECIFIEDEnumDefault value.
STRINGEnumA string of characters.
INTEGEREnumAn integer value.
FLOATEnumA floating point number.
TIMESTAMPEnumA timestamp in ISO 8601 format.
BOOLEANEnumA boolean value.
EMAIL_ADDRESSEnumA string in the format of an email address.
GOOGLE_USEREnumA user of the Google services, in the format of “users/encoded_GAIA_ID”
FILEEnumA file type.
FORMATTED_TEXTEnumA text with rich formatting.

Color

Methods

MethodReturn typeBrief description
setAlpha(alpha)ColorSets the alpha component of the color.
setBlue(blue)ColorSets the blue component of the color.
setGreen(green)ColorSets the green component of the color.
setRed(red)ColorSets the red component of the color.

DataType

Methods

MethodReturn typeBrief description
setBasicDataType(basicDataType)DataTypeSets the data type to one of the supportedBasicDataTypes.
setResourceType(resourceType)DataTypeSets the data type to a custom definedResourceType.
setValueMetadata(valueMetadata)DataTypeSets theValueMetadata, which contains type-related information related to thevariable.

DynamicResourceDefinition

Methods

MethodReturn typeBrief description
addResourceField(resourceField)DynamicResourceDefinitionAdds a resource field to the dynamic resource definition.
setResourceId(resourceId)DynamicResourceDefinitionSets the ID for the dynamic resource definition, this ID corresponds to theworkflowResourceDefinitionId in the manifest.

ErrorActionability

Properties

PropertyTypeDescription
ERROR_ACTIONABILITY_UNSPECIFIEDEnumUnspecified.
NOT_ACTIONABLEEnumThe error is not fixable by the user through the configuration card.
ACTIONABLEEnumThe error is fixable by the user through the configuration card.

ErrorRetryability

Properties

PropertyTypeDescription
RETRYABILITY_UNSPECIFIEDEnumUnspecified.
NOT_RETRYABLEEnumThe error is not retryable, the flow terminates after the first try.
RETRYABLEEnumThe error is retryable, Workflow is going to try to execute the Step for up to 5 times.

FontWeight

Properties

PropertyTypeDescription
FONT_WEIGHT_UNSPECIFIEDEnumStandard weight with normal thickness.
LIGHTEnumLighter weight with reduced thickness.
MEDIUMEnumIntermediate weight between light and bold.
BOLDEnumHeavier weight with increased thickness.

HostAppAction

Methods

MethodReturn typeBrief description
setWorkflowAction(workflowAction)HostAppActionSets the host app action to Workflow action.

Hyperlink

Methods

MethodReturn typeBrief description
setLink(link)HyperlinkSets the destination URL of the hyperlink.
setText(text)HyperlinkSets the text of the hyperlink.

InsertSection

Methods

MethodReturn typeBrief description
insertAtTop(onCardTop)InsertSectionSets the onCardTop flag, which indicates whether the new section should be inserted at the topof the card.
insertBelowSection(sectionId)InsertSectionSets the section ID, and the new section is inserted below it.
setSection(section)InsertSectionSets the card section to be inserted.

InsertWidget

Methods

MethodReturn typeBrief description
insertAboveWidget(widgetId)InsertWidgetSets the widget ID, and the new widget is inserted above the widget with the given ID.
insertBelowWidget(widgetId)InsertWidgetSets the widget ID, and the new widget is inserted below the widget with the given ID.
setWidget(widget)InsertWidgetSets theWidget to be inserted.

Link

Methods

MethodReturn typeBrief description
setTitle(title)LinkSets the title of the link.
setUrl(url)LinkSets the URL of the link.

ListContainer

Methods

MethodReturn typeBrief description
addListItem(listItem)ListContainerAdds a list item to the list container.
setListNestLevel(listLevel)ListContainerSets the level of the list, starts from 0 for the top level, and increases by 1 for each nestedlist.
setListType(listType)ListContainerSets the type of the list to be ordered or unordered.

ListItem

Methods

MethodReturn typeBrief description
addTextFormatElement(textFormatElement)ListItemAdds aTextFormatElement to the list item.

ListType

Properties

PropertyTypeDescription
LIST_TYPE_UNSPECIFIEDEnumDefault value.
ORDEREDEnumOrdered list.
UNORDEREDEnumUnordered list.

ModifyCard

Methods

MethodReturn typeBrief description
setInsertSection(insertSection)ModifyCardSets theInsertSection for this modify card object.
setInsertWidget(insertWidget)ModifyCardSets theInsertWidget for this modify card object.
setRemoveSection(removeSection)ModifyCardSets theRemoveSection for this modify card object.
setRemoveWidget(removeWidget)ModifyCardSets theRemoveWidget for this modify card object.
setReplaceSection(replacementSection)ModifyCardSets the replacementCardSection for this modify card object, the replacement sectionshould have the same id as an existing card section.
setReplaceWidget(replacementWidget)ModifyCardSets the replacement widget for this modify card object, the replacement widget should have thesame id as an existing widget.
setUpdateWidget(updateWidget)ModifyCardSets theUpdateWidget for this modify card object.

Navigation

Methods

MethodReturn typeBrief description
printJson()StringPrints the JSON representation of this object.
pushCard(card)NavigationPushes the given card onto the stack.

RemoveSection

Methods

MethodReturn typeBrief description
setSectionId(sectionId)RemoveSectionSets the section ID of the section to be removed.

RemoveWidget

Methods

MethodReturn typeBrief description
setWidgetId(widgetId)RemoveWidgetSets the widget ID of the widget to be removed.

RenderAction

Methods

MethodReturn typeBrief description
printJson()StringPrints the JSON representation of this object.

RenderActionBuilder

Methods

MethodReturn typeBrief description
build()RenderActionBuilds the current render action and validates it.
setAction(action)RenderActionBuilderSets the action that add-ons can use to update the UI to the render action.
setHostAppAction(hostAppAction)RenderActionBuilderSets theHostAppAction handled by individual host apps to the render action.

ResourceData

Methods

MethodReturn typeBrief description
addVariableData(key, value)ResourceDataAdds aVariableData keyed by its variable name, a value is overwritten if the keyalready exists.
setVariableDataMap(fields)ResourceDataSets the map of the variable data keyed by variable names.

ResourceField

Methods

MethodReturn typeBrief description
setDataType(dataType)ResourceFieldSets the data type of the field, allows other steps to filter the variables by type atselection.
setDisplayText(displayText)ResourceFieldSets the description of the field that is displayed to the end user during variable selectionin subsequent steps.
setSelector(selector)ResourceFieldSets a key for the provider function to provide the value to during the step's execution.

ResourceFieldsDefinitionRetrievedAction

Methods

MethodReturn typeBrief description
addDynamicResourceDefinition(dynamicResourceDefinition)ResourceFieldsDefinitionRetrievedActionAdds aDynamicResourceDefinition to the resource fields definition retrieved action.

ResourceRetrievedAction

Methods

MethodReturn typeBrief description
setResourceData(resourceData)ResourceRetrievedActionSets theResourceData to the resource retrieved action to provide values to the dynamicresource fields or custom resource fields.

ResourceType

Methods

MethodReturn typeBrief description
setWorkflowResourceDefinitionId(resourceType)ResourceTypeSets the workflow resource definition id.

ReturnElementErrorAction

Methods

MethodReturn typeBrief description
setErrorActionability(errorActionability)ReturnElementErrorActionSets the error actionability, an error should be actionable if it can be resolved byre-configuring the step.
setErrorLog(log)ReturnElementErrorActionSets the error log to be displayed to the end user at Workflow's activity feed.
setErrorRetryability(errorRetryability)ReturnElementErrorActionSets the error retry-ability, the flow terminates after the first try if an error is notretryable.

ReturnOutputVariablesAction

Methods

MethodReturn typeBrief description
addVariableData(key, value)ReturnOutputVariablesActionAdds a variable data keyed by its variable name, a value is overwritten if the key alreadyexists.
setLog(log)ReturnOutputVariablesActionSets the Log of the executed workflow action to the end user at Workflow's activity feed.
setVariableDataMap(variables)ReturnOutputVariablesActionSets the map of the variable data keyed by variable name, a value is overwritten if the keyalready exists.

SaveWorkflowAction

StyledText

Methods

MethodReturn typeBrief description
addStyle(style)StyledTextSets the style of the styled text, can apply multiple styles to a single styled text.
setColor(color)StyledTextSets the color of the styled text.
setFontWeight(fontWeight)StyledTextSets the font weight of the styled text.
setText(text)StyledTextSets the main content of the styled text.

TextFormatChip

Methods

MethodReturn typeBrief description
setLabel(label)TextFormatChipSets the text displayed in the chip.
setTextFormatIcon(icon)TextFormatChipSets the icon displayed in the chip.
setUrl(url)TextFormatChipSets the URL to navigate to when the chip is clicked.

TextFormatElement

Methods

MethodReturn typeBrief description
setHyperlink(hyperlink)TextFormatElementSets the text format element as aHyperlink.
setListContainer(listContainer)TextFormatElementSets the text format element as aListContainer.
setStyledText(styledText)TextFormatElementSets the text format element as aStyledText.
setText(text)TextFormatElementSets the text format element as a text string.
setTextFormatChip(chip)TextFormatElementSets the text format element as aTextFormatChip.

TextFormatIcon

Methods

MethodReturn typeBrief description
setIconUrl(iconUrl)TextFormatIconSets the icon URL.
setMaterialIconName(materialIconName)TextFormatIconSets the material icon name defined in Google Material Icons.

TextStyle

Properties

PropertyTypeDescription
STYLE_UNSPECIFIEDEnumNo style applied.
ITALICEnumItalic style.
UNDERLINEEnumUnderline style.
STRIKETHROUGHEnumStrikethrough style.
LINE_BREAKEnumLine break.
UPPERCASEEnumUppercase style.
CODEEnumCode style.
CODE_BLOCKEnumCode block style.

TimeStamp

Methods

MethodReturn typeBrief description
setNanos(nanos)TimeStampSets the nanos of the timestamp, it represents the number of nanoseconds within the currentsecond.
setSeconds(seconds)TimeStampSets the seconds of the timestamp, it represents the number of seconds since the Unixepoch(January 1, 1970, 00:00:00 UTC).

UpdateWidget

Methods

MethodReturn typeBrief description
addSuggestion(text, value, selected, startIconUri, bottomText)UpdateWidgetAdds a new item that can be selected, for multi-select menus.

ValidationErrorSeverity

Properties

PropertyTypeDescription
SEVERITY_UNSPECIFIEDEnumUnspecified.
CRITICALEnumCritical, the error is critical and must be fixed before publish.
WARNINGEnumWarning, the error is non-critical and is not blocking publish.

ValueMetadata

Methods

MethodReturn typeBrief description
addCastableType(dataType)ValueMetadataAdds a optional allowed types that can be dynamically casted for a variable data to this valuemetadata.
addEnumValue(enumValue)ValueMetadataAdds an optional string value to the allowed enum values of a variable, this field can only beset if theDataType is set to String type.
setDefaultValue(defaultValue)ValueMetadataSets the optional default value of the variable, example, if the variable type is boolean,defaultValue may be set to "true" or "false".

VariableData

Methods

MethodReturn typeBrief description
addBooleanValue(value)VariableDataAdds a boolean value to the variable data.
addEmailAddress(emailAddress)VariableDataAdds an email address to the variable data.
addFloatValue(value)VariableDataAdds a float value to the variable data.
addGoogleUser(googleUser)VariableDataAdds a google user to the variable data.
addIntegerValue(value)VariableDataAdds an integer value to the variable data.
addResourceData(resourceData)VariableDataAdds aResourceData value to the variable data.
addResourceReference(resourceReference)VariableDataAdds a resource reference ID to the variable data.
addStringValue(value)VariableDataAdds a string value to the variable data.
addTimestampValue(value)VariableDataAdds aTimeStamp value to the variable data.
addWorkflowTextFormat(workflowTextFormat)VariableDataAdds aWorkflowTextFormat value to the variable data.

WorkflowAction

WorkflowTextFormat

Methods

MethodReturn typeBrief description
addTextFormatElement(textFormatElement)WorkflowTextFormatAdds aTextFormatElement to the workflow text format.

WorkflowValidationErrorAction

Methods

MethodReturn typeBrief description
setSeverity(severity)WorkflowValidationErrorActionSets the severity of the validation error.

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-12-11 UTC.