Skip to main content

Tune Your Connector for Copilot

In order for the embedded workflow builder's AI copilot to understand how to use your connector's actions, you need to provide the copilot with enough information about your connector. This video focuses on two key recommendations for tuning your connector for the copilot:

  1. Provide detailed descriptions for your connector's actions and their inputs.
  2. Provide an examplePayload for your connector's actions to help the copilot understand how data can flow between steps.

It's important that each action has a good description and example payload:

Example action with description and example payload
export const getPerson = action({
display: {
label: "Get Person",
description: "Get a person stored in the Acme People API by their ID",
},
inputs: {
connection: connectionInput,
personId: input({
label: "Person ID",
comments: "A numerical ID of a person stored in the Acme People API"
type: "string",
required: true,
clean: util.types.toString,
}),
},
perform: async (_context, { connection, personId }) => {
// Fetch the specific person using the selected ID
const client = getPeopleClient(connection);
const response = await client.get<Person>(`/users/${personId}`);
return { data: response.data };
},
examplePayload: {
data: {
id: 1,
name: "Leanne Graham",
username: "Bret",
email: "Sincere@april.biz",
address: {
street: "Kulas Light",
suite: "Apt. 556",
city: "Gwenborough",
zipcode: "92998-3874",
geo: {
lat: "-37.3159",
lng: "81.1496",
},
},
phone: "1-770-736-8031 x56442",
website: "hildegard.org",
company: {
name: "Romaguera-Crona",
catchPhrase: "Multi-layered client-server neural-net",
bs: "harness real-time e-markets",
},
},
},
});