# Create and Run Task — Skyvern

> Create a new task and run it instantly in Skyvern. Useful for one-off automations. See the documentation

- Key: `skyvern-create-run-task`
- Type: Action (Write)
- Version: 0.0.3
- App: Skyvern (`skyvern`) — https://pipedream.com/apps/skyvern.md
- This page (HTML): https://pipedream.com/apps/skyvern/actions/create-run-task
- Hints: open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/skyvern/actions/create-run-task/create-run-task.mjs

## Description

Create a new task and run it instantly in Skyvern. Useful for one-off automations. [See the documentation](https://docs.skyvern.com/)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `url` | `string` | Yes | It must be a http or https URL. |
| `navigationGoal` | `string` | No | The prompt that tells the agent what the user-facing goal is. This is the guiding light for the LLM as it navigates a particular website / sitemap to achieve this specified goal. |
| `dataExtractionGoal` | `string` | No | The prompt that instructs the agent to extract information once the agent has achieved its User Goal. |
| `navigationPayload` | `object` | No | JSON-formatted payload with any "facts" or information that would help the agent perform its job. In the case of navigating an insurance quote, this payload would include any user information to help fill out the insurance flow such as date of birth, or age they got their license, and so on. This can include nested information, and the formatting isn't validated. |
| `webhookCallbackUrl` | `string` | No | The callback URL once our system is finished processing this async task. |
| `extractedInformationSchema` | `object` | No | Used to enforce a JSON schema spec to be enforced in the data_extraction_goal. Similar to https://json-schema.org/ definition. |
| `totpVerificationUrl` | `string` | No | The URL of your TOTP endpoint. If this field is provided, Skyvern will call the URL to fetch the TOTP/2FA/MFA code when needed. |
| `totpIdentifier` | `string` | No | The email address or the phone number which receives the TOTP/2FA/MFA code. If this field is provided, Skyvern will fetch the code that is pushed to Skyvern's TOTP API. |

## Run it

**MCP**

```ts
import { Client } from "@modelcontextprotocol/sdk/client/index.js"
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js"
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const accessToken = await pd.rawAccessToken

const transport = new StreamableHTTPClientTransport(
  new URL("https://remote.mcp.pipedream.net/v3"),
  {
    requestInit: {
      headers: {
        Authorization: `Bearer ${accessToken}`,
        "x-pd-project-id": process.env.PIPEDREAM_PROJECT_ID!,
        "x-pd-environment": "production",
        "x-pd-external-user-id": "{external_user_id}", // any stable ID for this user in your system
        "x-pd-app-slug": "skyvern",
      },
    },
  },
)

const mcp = new Client({ name: "my-agent", version: "1.0.0" })
await mcp.connect(transport)

const { tools } = await mcp.listTools()

// listTools() hands your model this tool's input schema, so it can
// fill the arguments itself:
const result = await mcp.callTool({
  name: "skyvern-create-run-task",
  arguments: {
    url: "URL",
    navigationGoal: "Navigation Goal",
  },
})
```

**TypeScript**

```ts
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const result = await pd.actions.run({
  id: "skyvern-create-run-task",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    skyvern: { authProvisionId: "apn_xxxxxxx" },
    url: "URL",
    navigationGoal: "Navigation Goal",
  },
})

console.log(result)
```

**cURL**

```bash
curl -X POST https://api.pipedream.com/v1/connect/{project_id}/actions/run \
  -H "Content-Type: application/json" \
  -H "X-PD-Environment: production" \
  -H "Authorization: Bearer {access_token}" \
  -d '{
    "external_user_id": "{external_user_id}",
    "id": "skyvern-create-run-task",
    "configured_props": {
      "skyvern": { "authProvisionId": "apn_xxxxxxx" },
      "url": "URL",
      "navigationGoal": "Navigation Goal"
    }
  }'
```

---

- App: https://pipedream.com/apps/skyvern.md · All apps: https://pipedream.com/apps
