> ## 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.

# Attention: Execute Crmquery

> Run a query, such as Salesforce SOQL, against the CRM connected to Attention. Includes SDK V2 examples, input constraints, response fields, and Deepline cost.

Run a query, such as Salesforce SOQL, against the CRM connected to Attention.

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

## 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(
  'attention_execute_crmquery',
  {
    "query": "software companies hiring engineers"
  },
);

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

### CLI

```bash theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
deepline tools execute attention_execute_crmquery --input '{
  "query": "software companies hiring engineers"
}' --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": {
    "records": [
      {}
    ],
    "totalSize": 123,
    "done": true
  }
}
```

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

## Input reference

Executes a query against the connected CRM platform (e.g., Salesforce SOQL). The query is validated for security before execution.

| Name | Type | Required | Default | Details |
| - | - | - | - | - |
| `payload.query` | `string` | Yes | — | The query to execute (e.g., SOQL for Salesforce) Maximum length: 10000. |

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

  ### Input JSON Schema

  ```json theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
  {
    "type": "object",
    "description": "Executes a query against the connected CRM platform (e.g., Salesforce SOQL). The query is validated for security before execution.",
    "properties": {
      "query": {
        "type": "string",
        "description": "The query to execute (e.g., SOQL for Salesforce)",
        "maxLength": 10000
      }
    },
    "required": [
      "query"
    ],
    "additionalProperties": false
  }
  ```
</details>

## Output reference

Standard tool result payload.

| Name | Type | Required | Default | Details |
| - | - | - | - | - |
| `result.data` | `object` | Yes | — | Provider response payload. |
| `result.data.records` | `array` | No | — | Query result records |
| `result.data.totalSize` | `integer` | No | — | Total number of records matching the query |
| `result.data.done` | `boolean` | No | — | Whether all records have been returned |
| `result.data.nextRecordsUrl` | `string` | No | — | URL to fetch the next batch of records (if paginated) |
| `result.meta` | `object` | 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": {
          "records": {
            "type": "array",
            "description": "Query result records",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "totalSize": {
            "type": "integer",
            "description": "Total number of records matching the query"
          },
          "done": {
            "type": "boolean",
            "description": "Whether all records have been returned"
          },
          "nextRecordsUrl": {
            "type": "string",
            "description": "URL to fetch the next batch of records (if paginated)"
          }
        },
        "additionalProperties": false
      },
      "meta": {
        "type": "object",
        "description": "Additional response metadata (status, paging).",
        "additionalProperties": true
      }
    },
    "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

* [Attention provider guide](https://deepline.com/docs/providers/attention/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.