# Programming examples

Copy, deploy and adapt complete Python services for every system the platform connects to.

## Get started

A per-user LLM chat with managed history - complete and runnable.

[LLM chat](https://zato.io/docs/ai/examples/chat-with-memory.html)

service.py

```
# Every example is a complete service
class MyService(Service):

    def handle(self):
        conn = self.out.sql['My Database']
        rows = conn.execute(query, params)

        self.cache.set('rows', rows)
        self.response.payload = rows
```

## AI

[LLM chat A per-user LLM chat with managed history - one chat\_id per user.](https://zato.io/docs/ai/examples/chat-with-memory.html) [MCP tools Expose secured enterprise APIs to agents as MCP tools.](https://zato.io/docs/ai/examples/secured-apis-as-tools.html) [Structured output Reliable JSON out of a model, validated and retried.](https://zato.io/docs/ai/examples/structured-output.html) [Self-hosted models One service against hosted and self-hosted models.](https://zato.io/docs/ai/examples/self-hosted-models.html)

## REST

[REST Accept REST calls, react to HTTP verbs and invoke REST APIs from your services.](https://zato.io/docs/dev/examples/rest.html)

## Databases

[PostgreSQL Query and update PostgreSQL from your services.](https://zato.io/docs/dev/examples/sql/postgresql.html) [MySQL Query and update MySQL and MariaDB from your services.](https://zato.io/docs/dev/examples/sql/mysql.html) [Oracle Query and update Oracle Database from your services.](https://zato.io/docs/dev/examples/sql/oracle.html) [SQL Server Query and update Microsoft SQL Server from your services.](https://zato.io/docs/dev/examples/sql/mssql.html) [Snowflake Query Snowflake warehouses from your services.](https://zato.io/docs/dev/examples/sql/snowflake.html) [Redshift Query Amazon Redshift clusters from your services.](https://zato.io/docs/dev/examples/sql/redshift.html) [MongoDB Insert, find and update MongoDB documents from your services.](https://zato.io/docs/dev/examples/mongodb.html) [Redis Store and retrieve Redis keys, lists and hashmaps from your services.](https://zato.io/docs/dev/examples/redis.html) [ElasticSearch Index and query ElasticSearch documents from your services.](https://zato.io/docs/dev/examples/search/elastic-search.html)

## Microsoft

[Microsoft 365 files Upload and download SharePoint and OneDrive files of any size from your services.](https://zato.io/docs/dev/examples/cloud/ms365-files.html) [Teams Send Teams messages to channels, people and groups from your services.](https://zato.io/docs/dev/examples/microsoft-teams.html) [Dynamics 365 Read and write Dynamics 365 data - Finance and Operations, Business Central and Dataverse.](https://zato.io/docs/dev/examples/dynamics-365.html) [Power Automate Trigger, manage and monitor Power Automate flows from your services.](https://zato.io/docs/dev/examples/cloud/power-automate/index.html) [Microsoft Fabric Manage Fabric workspaces, run notebooks and pipelines and work with OneLake from Python.](https://zato.io/docs/dev/examples/cloud/fabric/index.html) [Azure Service Bus Receive and send Azure Service Bus messages, acknowledging or rejecting each one.](https://zato.io/docs/dev/examples/azure-service-bus.html)

## Message queues

[AMQP Send and receive AMQP messages with RabbitMQ and other brokers.](https://zato.io/docs/dev/examples/amqp.html) [Kafka Consume Kafka topics through channels and publish to them from your services.](https://zato.io/docs/dev/examples/kafka.html) [IBM MQ Receive and send IBM MQ messages from your services.](https://zato.io/docs/dev/examples/ibm-mq.html) [Azure Service Bus Receive and send Azure Service Bus messages, acknowledging or rejecting each one.](https://zato.io/docs/dev/examples/azure-service-bus.html) [Built-in pub/sub Publish and subscribe to topics with the built-in message broker.](https://zato.io/docs/eda/index.html)

## AWS

[S3 Upload, download and list S3 objects from your services.](https://zato.io/docs/dev/examples/cloud/aws/s3.html) [SQS Send and receive SQS messages from your services.](https://zato.io/docs/dev/examples/cloud/aws/sqs.html) [SNS Publish SNS notifications from your services.](https://zato.io/docs/dev/examples/cloud/aws/sns.html) [Lambda Invoke Lambda functions from your services.](https://zato.io/docs/dev/examples/cloud/aws/lambda.html) [EC2 Start, stop and describe EC2 instances from your services.](https://zato.io/docs/dev/examples/cloud/aws/ec2.html) [DynamoDB Read and write DynamoDB items from your services.](https://zato.io/docs/dev/examples/cloud/aws/dynamodb.html) [CloudWatch Publish metrics and read logs in CloudWatch from your services.](https://zato.io/docs/dev/examples/cloud/aws/cloudwatch.html)

## Files and email

[SFTP Upload, download, read and write files on SFTP servers from your services.](https://zato.io/docs/dev/examples/sftp.html) [SMB Read and write files on SMB and Windows shares from your services.](https://zato.io/docs/dev/examples/smb.html) [SMTP Send plain-text and HTML email with attachments from your services.](https://zato.io/docs/dev/examples/smtp.html) [IMAP Receive and process email from IMAP mailboxes, including Microsoft 365 with OAuth2.](https://zato.io/docs/dev/examples/imap.html)

## Scheduler

[Scheduler Run services on an interval, at a specific time or on a cron expression.](https://zato.io/docs/dev/examples/scheduler.html)

## Platform features

[Cache Store and retrieve data in the built-in cache with a Python API.](https://zato.io/docs/dev/examples/cache.html) [Configuration tables Translate each partner's codes into yours and validate accepted values.](https://zato.io/docs/dev/examples/config-tables.html) [Config files Read configuration from .ini files at runtime, with hot reloads and no restarts.](https://zato.io/docs/dev/examples/config.html) [Messages Build nested messages and responses through plain dot access.](https://zato.io/docs/dev/examples/messages.html) [Data models Define typed API contracts for requests and responses.](https://zato.io/docs/dev/examples/model.html) [Input and output Declare each service's input and output - field names or typed models.](https://zato.io/docs/dev/input-output.html) [Shell commands Turn shell commands into API services you can invoke.](https://zato.io/docs/dev/examples/shell-commands.html)

## Collaboration

[Slack Send Slack messages to channels, people and groups from your services.](https://zato.io/docs/dev/examples/slack.html) [Jira Create and update Jira tickets from Python - queries, transitions, comments and attachments.](https://zato.io/docs/dev/examples/jira.html)

## IT Ops

[NetBox Query and update NetBox records, and stay in sync with its webhooks.](https://zato.io/docs/dev/examples/netbox.html) [Palo Alto Query Palo Alto Panorama logs from your services - traffic, threats and URLs.](https://zato.io/docs/dev/examples/palo-alto.html)

## More protocols

[SOAP Invoke SOAP operations from Python - no envelopes and no WSDL compilation.](https://zato.io/docs/dev/examples/soap.html) [GraphQL Query GraphQL endpoints from your services - variables, mutations and the DSL included.](https://zato.io/docs/dev/examples/graphql.html) [gRPC Call gRPC endpoints from your services, with all four call shapes and TLS.](https://zato.io/docs/dev/examples/grpc.html)
