> For the complete documentation index, see [llms.txt](https://docs.stackai.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.stackai.com/guides-and-quickstarts/workflow-builder/ai-assisted-workflow-editing.md).

# AI assisted workflow editing

Ask AI helps you change a workflow from a written request. Use it to describe the behavior you need and the parts that must remain unchanged.

{% embed url="<https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSQ1Sgy933krTyK0S4JpP%2Fuploads%2FAeu5KAPEezYUGguyhrun%2FG035.mp4?alt=media&token=a12c7562-22e4-4339-9eda-87d0e312d1ee>" %}

## Review the current workflow

Run the current workflow and inspect its result before requesting a change.

![Current workflow result before an AI change](https://content.gitbook.com/content/SQ1Sgy933krTyK0S4JpP/blobs/lryd7KpddkqByw2QRYWq/assets/g035-g035-01-baseline.png)

This gives you a clear starting point for reviewing what the change affects.

## Request a change

Open Ask AI and describe the required change and any behavior that must remain unchanged.

![Ask AI change request](https://content.gitbook.com/content/SQ1Sgy933krTyK0S4JpP/blobs/BvsEIc5NllquiE611mvl/assets/g035-g035-02-request.png)

Include the source values the new step should use.

## Review the proposal

Review the proposed nodes, settings, and connections before applying the proposal.

![Proposed workflow nodes and connections](https://content.gitbook.com/content/SQ1Sgy933krTyK0S4JpP/blobs/iB9FZAJDolDXVKuLbWOi/assets/g035-g035-03-proposal.png)

Check that the planned path addresses the requested task.

Inspect warnings in the proposed workflow.

![Warnings in an AI-generated proposal](https://content.gitbook.com/content/SQ1Sgy933krTyK0S4JpP/blobs/tKimmfD8kCc5c850gT9F/assets/g035-g035-04-preview.png)

Generated changes can contain invalid references or other configuration problems that need correction.

## Correct references and templates

Open any node with a reference warning and correct its source mapping.

![Source mapping for a reference warning](https://content.gitbook.com/content/SQ1Sgy933krTyK0S4JpP/blobs/jJ3drBMalUvCQIgx01zI/assets/g035-g035-05-repair.png)

Use the actual connected result rather than keeping an invalid custom template.

Inspect new templates and confirm that their fields are live references.

![Live references in a generated template](https://content.gitbook.com/content/SQ1Sgy933krTyK0S4JpP/blobs/kJ8oYniAlOHx60Qx8UJ2/assets/g035-g035-06-template.png)

Copied result values will not update on later runs.

## Check and save the result

Review the original inputs and code to confirm that required behavior was retained.

![Original inputs and code after the proposed changes](https://content.gitbook.com/content/SQ1Sgy933krTyK0S4JpP/blobs/9wm6TC5lMPXZmStmOG7G/assets/g035-g035-07-code.png)

Restore any unintended change before saving the workflow.

Run the complete updated path and inspect Output.

![Updated workflow Output](https://content.gitbook.com/content/SQ1Sgy933krTyK0S4JpP/blobs/Cd1y4K8UijzPwDVRaAdl/assets/g035-g035-08-result.png)

Save the draft after confirming that the new step and the retained behavior work together.

## Important behavior

AI-generated changes require review. Check the changed nodes, data references, and access to external services before using the workflow.

## Related steps

* [Map variables and expressions](/guides-and-quickstarts/workflow-builder/map-variables-and-expressions.md)
* [Workflow debugging and node results](/guides-and-quickstarts/workflow-builder/workflow-debugging-and-node-results.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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.stackai.com/guides-and-quickstarts/workflow-builder/ai-assisted-workflow-editing.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
