# Proactive Agents in Embedding

You can add [Proactive Agents](/proactive-agents/getting-started.md) to the embedding experience by creating the Proactive Agents in the UI, and then sharing those Proactive Agents with "all users" as Viewer (which only gives the ability to *run* the Proactive Agent).

<figure><img src="/files/81nFB5BKbDDJvRIDhodM" alt=""><figcaption></figcaption></figure>

Once you have those Proactive Agents created and shared, you will see the lightning bolt option in the embedded UI to run the Proactive Agents.

{% hint style="info" %}
Use the right role

Only the `embedded_with_scheduling` role has access to Proactive Agents, so you will not see the option to run Proactive Agents if you only use the `embed` role.
{% endhint %}

In the chat UI, that will look like this

![workflow-in-chat](/files/LMzeneeIcQ7DDyTvtMST)

## Running automatically

To run Proactive Agents without making the user pick which Proactive Agent they want to run, you will pass query parameters to select the Proactive Agent you want to use.

You can get the Proactive Agent ID from the 3 dot menu or the URL from the Proactive Agent Builder page. You will pass query parameters like this to run a Proactive Agent

`https://app.zenlytic.com/chat?workflowId=<my-proactive-agent-id>`

That will kick off the run of the Proactive Agent. If the Proactive Agent requires inputs, it will open a modal asking the user for the inputs. If it does not require inputs, the Proactive Agent will start running immediately.

Note: you can also run a normal chat question via query parameters as well. To do that you will pass query parameters in the URL like this:

`https://app.zenlytic.com/chat?q=hello`

This will initiate the conversation with the user's question `"hello"`.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.zenlytic.com/embedding/workflows_in_embedding.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
