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

# Salesforce: Create Task

> Log a call, email, or other activity on a Salesforce lead or contact as a Task. Includes SDK V2 examples, input constraints, response fields, and Deepline cost.

Log a call, email, or other activity on a Salesforce lead or contact as a Task.

> [!NOTE]
>
> Tool ID: `salesforce_create_task`

## Run this action

Use the TypeScript SDK for one call. Use `ctx.tools.execute(...)` inside a Play for durable calls, scheduled calls, or CSV processing.

```ts theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
import { Deepline } from 'deepline';

const deepline = await Deepline.connect();
const result = await deepline.tools.execute(
  'salesforce_create_task',
  {
    "subject": "Introduction",
    "who_id": "who_123"
  },
);

console.log(result.toolResponse.raw);
```

### CLI

```bash theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
deepline tools execute salesforce_create_task --input '{
  "subject": "Introduction",
  "who_id": "who_123"
}' --json
```

## Example response

The SDK returns this shape at `result.toolResponse.raw`. The example values illustrate the response.

```json theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
{
  "data": {
    "id": "id_123",
    "success": true,
    "errors": [
      {}
    ]
  }
}
```

Use `deepline describe salesforce_create_task --json` for the latest machine-readable contract.

## Input reference

Log a completed or open activity as a Salesforce Task.

| Name | Type | Required | Default | Details |
| - | - | - | - | - |
| `payload.subject` | `string` | Yes | — | Task subject, for example `Call: discovery`. Minimum length: 1. Maximum length: 255. |
| `payload.who_id` | `string` | Yes | — | Lead (00Q) or Contact (003) ID the activity is about. |
| `payload.what_id` | `string` | No | — | Related record ID, for example an Account (001), Opportunity (006), or Campaign (701). Not allowed when who\_id is a Lead. |
| `payload.status` | `string` | No | `"Completed"` | Task status. Defaults to `Completed`. Minimum length: 1. |
| `payload.activity_date` | `string` | No | — | Due or completed date, YYYY-MM-DD. Pattern: `^\d&#123;4&#125;-\d&#123;2&#125;-\d&#123;2&#125;$`. |
| `payload.description` | `string` | No | — | Task comments. Maximum length: 32000. |
| `payload.task_subtype` | `"Call" \| "Email" \| "Task"` | No | — | Salesforce TaskSubtype: Call, Email, or Task. Allowed: `Call`, `Email`, `Task`. |
| `payload.owner_id` | `string` | No | — | Assigned user ID (005). Defaults to the connected user. |
| `payload.fields` | `record` | No | — | Salesforce field API names to write directly, including custom fields like `Deepline_Score__c`. Values may be strings, numbers, booleans, or null to clear a field. |

<details>
  <summary>Show raw input schema</summary>

  ### Input JSON Schema

  ```json theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
  {
    "type": "object",
    "description": "Log a completed or open activity as a Salesforce Task.",
    "properties": {
      "subject": {
        "type": "string",
        "description": "Task subject, for example `Call: discovery`.",
        "minLength": 1,
        "maxLength": 255
      },
      "who_id": {
        "type": "string",
        "description": "Lead (00Q) or Contact (003) ID the activity is about."
      },
      "what_id": {
        "type": "string",
        "description": "Related record ID, for example an Account (001), Opportunity (006), or Campaign (701). Not allowed when who_id is a Lead."
      },
      "status": {
        "type": "string",
        "description": "Task status. Defaults to `Completed`.",
        "default": "Completed",
        "minLength": 1
      },
      "activity_date": {
        "type": "string",
        "description": "Due or completed date, YYYY-MM-DD.",
        "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
      },
      "description": {
        "type": "string",
        "description": "Task comments.",
        "maxLength": 32000
      },
      "task_subtype": {
        "type": "string",
        "description": "Salesforce TaskSubtype: Call, Email, or Task.",
        "enum": [
          "Call",
          "Email",
          "Task"
        ]
      },
      "owner_id": {
        "type": "string",
        "description": "Assigned user ID (005). Defaults to the connected user."
      },
      "fields": {
        "type": "object",
        "description": "Salesforce field API names to write directly, including custom fields like `Deepline_Score__c`. Values may be strings, numbers, booleans, or null to clear a field.",
        "additionalProperties": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "number"
            },
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ]
        }
      }
    },
    "required": [
      "subject",
      "who_id"
    ],
    "additionalProperties": false
  }
  ```
</details>

## Output reference

Standard tool result payload.

| Name | Type | Required | Default | Details |
| - | - | - | - | - |
| `result.data` | `object` | Yes | — | Provider response payload. |
| `result.data.id` | `string` | Yes | — | — |
| `result.data.success` | `boolean` | Yes | — | — |
| `result.data.errors` | `array` | Yes | — | — |
| `result.meta` | `record` | No | — | Additional response metadata (status, paging). |

<details>
  <summary>Show raw output schema</summary>

  ### Output JSON Schema

  ```json theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
  {
    "type": "object",
    "description": "Standard tool result payload.",
    "properties": {
      "data": {
        "type": "object",
        "description": "Provider response payload.",
        "properties": {
          "id": {
            "type": "string"
          },
          "success": {
            "type": "boolean"
          },
          "errors": {
            "type": "array",
            "items": {}
          }
        },
        "required": [
          "id",
          "success",
          "errors"
        ],
        "additionalProperties": false
      },
      "meta": {
        "type": "object",
        "description": "Additional response metadata (status, paging).",
        "additionalProperties": {}
      }
    },
    "required": [
      "data"
    ],
    "additionalProperties": false
  }
  ```
</details>

## Deepline cost

* Pricing model: `fixed` (per call).
* Estimated Deepline credits: `0` per pricing unit.
* Provider-native pricing may still exist outside Deepline credit billing.

## Related documentation

* [Salesforce provider guide](https://deepline.com/docs/providers/salesforce/guide.md)
* [SDK V2 quickstart](https://deepline.com/docs/sdk-v2/quickstart.md)
* [SDK reference](https://deepline.com/docs/sdk-v2/sdk-reference.md)
* [Run tools across a CSV](https://deepline.com/docs/sdk-v2/batch-csv.md)


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