
Description
This Node embeds external websites directly into the Agent Copilot workspace. To do that, specify a URL for the external content you want to display. You can present web pages, forms, or applications within the Agent Copilot workspace without redirecting human agents to an external site.Parameters
| Parameter | Type | Description |
|---|---|---|
| Tile ID | CognigyScript | The ID that you created in the Agent Copilot configuration. |
| IFrame URL | URL | The URL to render inside the Widget. |
| JSON Data | JSON | The data to send to the iframe as a postMessage event. |
Passing JSON Data into the IFrame
When you use a Copilot: IFrame Tile Node, JSON data is passed into the iframe code using the postMessage method. To receive and process the passed JSON in your widget, add an event listener inside the iframe content:Example: Dynamic IFrame Content
Example: Dynamic IFrame Content
Send Data from the IFrame Back to the Flow
User actions inside the iframe, such as form submissions or button clicks, can trigger logic in the Agent Copilot Flow. To send data from an iframe back to the Agent Copilot Flow, use the browser messaging API methodwindow.parent.postMessage(). The Agent Copilot workspace receives this message and forwards it to the Flow using SDK.postback.
Only the workspace can call
SDK.postback. The iframe itself can’t call it directly because it runs in an isolated context.Send Data back to the Flow
Send Data back to the Flow
IFrame sends data
The iframe sends a JSON object as data to the Agent Copilot workspace via
window.parent.postMessage().Workspace receives the message
The Agent Copilot workspace receives messages via an HTML tile controlled by the Copilot: HTML Tile Node, which listens for messages from the iframe.
The HTML Tile tile doesn’t need to be visible, but it must exist in the workspace.In this example:
window.parent.addEventListenerensures the message is caught from the parent workspace.- Only data with the
nameproperty is sent to the Flow. SDK.postbackautomatically wraps the data into the_agentAssistpayload for the Flow.
HTML Tile forwards data to the Flow
The HTML Tile forwards the received data to the Agent Copilot Flow using
SDK.postback.Example: Name Submission from an IFrame
Example: Name Submission from an IFrame