> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dify.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Build Apps

> Have your coding agent build, change, test, and publish your Workflow and Chatflow apps

We recommend having your coding agent build your apps. All you do is describe the app, answer what it asks, and set up what it can't.

## Before You Start

* Your agent is [set up](/en/cli/get-started.md#set-up-your-coding-agent): it has the `difyctl` skill and a sign-in to your Dify server.
* The account the agent signs in with has the Editor role or above.
* The API key for the model you want the app to use is set up in Dify.
* `jq` is installed on the machine where your agent runs.
* If you're changing an existing app, its Service API access is turned on.

## What the Agent Can Do

Describe a new app, or name one you already have and say what to change. The agent works out with you what the app should do and how to test it, then builds and tests it. The `difyctl` skill tells it to publish only when you say yes.

For example:

```text wrap theme={null}
Build a Chatflow that answers customer questions from our Help Center knowledge base.
```

```text wrap theme={null}
Build a Workflow that reads a support ticket, sorts it by urgency, and drafts a reply.
```

You can also ask it to:

* **Check that it works**: Test a single node or the whole draft, run the published app to try it, or look into a failed run to see which node broke and why.

* **Publish**: See whether the app is ready to publish and what's changed since its last published version, then publish it.

* **Roll back**: Restore an earlier published version and publish it again.

  > [!WARNING]
  >
  > Restoring replaces any unpublished changes in the draft. If the draft holds work you want to keep, ask the agent to export it first.

* **Set up what the app needs**: Install integrations from the Marketplace (when your workspace allows it) and set the app's environment variables.

* **Manage the app**: Export its DSL, turn its web app on or off, and change its basic information (name, icon, or description). With an Admin or Owner role, it can also turn the app's Service API access on or off.

## What the Agent Can't Do

The agent builds and changes only Workflow and Chatflow apps. It can build a workflow that starts with a trigger, but can't test or run it.

If the app needs any of these, do them yourself in Dify:

* Authorize a tool that signs in with OAuth.
* Install an integration from GitHub or a package file.
* Create a knowledge base and upload its documents.

## While the Agent Works

Until the agent is done, don't edit the app in Studio, and keep teammates out of it too. A change saved there stops the agent's next update.

The agent saves its work on each app in its own folder under `difyctl/`, inside the folder you start it from. Keep that folder, and start the agent from the same place next time. From there, it can pick up an unfinished build, or build on its earlier work when you ask for a change.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.