> For the complete documentation index, see [llms.txt](https://docs.airops.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.airops.com/docs/de/aktionen/workflow-concepts/workflow-steps/logic-steps/sql-query.md).

# SQL-Abfrage ausführen

Fragen Sie Ihre Datenbank direkt aus einem Workflow ab

Mit dem Schritt „SQL Query“ kannst du Abfragen direkt auf deinen verbundenen Datenbanken ausführen. Das kann nützlich sein, um Daten in deine Workflows zu übernehmen oder sogar Workflows zu erstellen, die direkt in deine Datenbanken schreiben.

## Einen Schritt „SQL Query“ konfigurieren

Der Schritt „SQL Query“ ist recht einfach einzurichten. Voraussetzung ist lediglich, dass du eine SQL-Datenbank über einen Benutzer mit Leseberechtigung verbunden hast. Weitere Informationen findest du auf unserer Dokumentationsseite zum Thema [Datenquellen verbinden](https://docs.airops.com/docs/de/kontext/knowledge-bases/add-data/import-from-sql-database/data-sources.md) .

Sobald du erfolgreich eine Datenquelle verbunden hast, kannst du wie unten gezeigt einen Schritt „SQL Query“ zu deinen Workflows hinzufügen:

{% @arcade/embed url="<https://app.arcade.software/share/10JanDKu9KE0Ahb7n7Fp>" flowId="10JanDKu9KE0Ahb7n7Fp" %}

Einer der wirkungsvollsten Anwendungsfälle für unseren Schritt „SQL Query“, die wir bisher gesehen haben, ist der Einsatz eines Agents, der dich beim Schreiben und Bearbeiten deiner eigenen Abfragen unterstützt. Das war so beliebt, dass wir unsere Agent-Vorlage „Data Sidekick“ darauf aufgebaut haben.

Wenn du dich näher mit deinen Anwendungsfällen beschäftigst, empfehlen wir dir, einen kurzen Blick hinter die Kulissen zu werfen:

<figure><img src="https://1960680173-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FX2n5yPRPynbnWuO4SH0M%2Fuploads%2Fgit-blob-fc285546ee3b693fb51ce6e6712b54b78b6cc005%2Fsql-step-01-example.png?alt=media" alt="Launch Pricing Analyst Workflow with a SQL Query step that selects launches from the SpaceOps Warehouse, a Run Code step that formats the rows, and a Prompt LLM step that answers the question"><figcaption><p>Ein Schritt „SQL Query“ übergibt Zeilen an den restlichen Workflow.</p></figcaption></figure>

## Fehler wegen Zeitüberschreitung bei Abfragen

Wenn der Datenbank-Connector sein Anfragelimit von 300 Sekunden erreicht, meldet der Schritt **The query timed out after 300 seconds**. Überprüfe die Abfrage und die Datenbankleistung oder reduziere die angeforderte Datenmenge, bevor du es erneut versuchst. Durch einen erneuten Versuch wird das Zeitlimit des Connectors nicht erhöht.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.airops.com/docs/de/aktionen/workflow-concepts/workflow-steps/logic-steps/sql-query.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
