--- AI TRACKER METADATA ---
Update Summary: Enable Webform Agents Within Canvas AI Pages
Check-in Date: MM/DD/YYYY (US format) [When we should see progress/get an update]
Due Date: MM/DD/YYYY (US format) [When the issue should be fully completed]
Blocked by: [#XXXXXX] (New issues on new lines)
Additional Collaborators: @username1, @username2
AI Tracker found here: https://www.drupalstarforge.ai/
--- END METADATA ---

Overview

Webform agents can be used by Canvas AI Agents to appear inside a page.
Linked to this https://www.drupal.org/project/ai_agents/issues/3544633

Proposed resolution

User interface changes

CommentFileSizeAuthor
#2 block-selection.patch4.53 KBmarcus_johansson

Comments

catia_penas created an issue. See original summary.

marcus_johansson’s picture

StatusFileSize
new4.53 KB

Since we will demo this and I have a patch for demoing purposes, I have added it here, but it's just for demoing purposes and will also show the problem with the current frontend solution, where we are pushing things into forms - since the Webform Block needs the autocomplete Webform title, while the validation requires the actual webform_id.

See https://www.drupal.org/files/issues/2025-10-14/block-selection.patch

marcus_johansson’s picture

The issue is the following:

1. When using the template agent we are doing validations on the structure and that means if you use something like the webform block it as one input that is webform id. The validation of this takes the webform id, which is fine. We gave the agent access to all public webforms in the Driesnote demo with label and id, so it could extrapolate which id we meant from the text in the chat, even if it was not the perfect label or id.
2. When this has passed, we use the frontend/canvas js to fill in the form - the problem is that this form field is an autocomplete field, so unless the id and label is the same (like contact form), this will just fail because it wants to take the actual label. For the Driesnote this is transformed to the label, but this is of course not a valid solution. Thus why I just added this in a patch and not a MR. Using label there in general is not great, since its not unique and would just choose the first one.