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

# Example 1: AI auto-reply

This example demonstrates how to implement a basic automated reply workflow using n8n, a large language model and a YCloud node:<br />When the YCloud platform receives an inbound message, it triggers an n8n workflow via a webhook. The workflow calls upon the large language model to generate a reply, and then sends the message back to the user via the YCloud node.

> YCloud AI Agent has built a comprehensive AI workflow for you, offering an end-to-end, easy-to-understand AI knowledge base, corpora and automated processes. Click here for more details.

### Overall Process

<img src="https://mintcdn.com/lchnan/7IqVC2giQEcOq6-5/product-assets/31a5e257bb-image-835.webp?fit=max&auto=format&n=7IqVC2giQEcOq6-5&q=85&s=45da1a8b4fd560222e1adc5d9e57bd47" alt="YCloud product screenshot" width="1739" height="787" data-path="product-assets/31a5e257bb-image-835.webp" />

### Webhook Event

1. Create a Webhook endpoint
   1. Use the n8n Webhook Node to create a new listener
   2. Select POST as the HTTP method
   3. In the Options, set the Response Code to 200 and ensure that ‘Immediately’ is selected

<img src="https://mintcdn.com/lchnan/PCdfO4VGvgYoGyQM/product-assets/fc7f38f8c3-ishot-2026-04-30-10-25-09.webp?fit=max&auto=format&n=PCdfO4VGvgYoGyQM&q=85&s=68fa46fe890c8b71626e7b2e4afb6860" alt="YCloud product screenshot" width="1920" height="993" data-path="product-assets/fc7f38f8c3-ishot-2026-04-30-10-25-09.webp" />

Add your endpoint details to the YCloud platform and select the Webhook events you wish to monitor

<Frame caption="Use Search event to find the webhook events your n8n workflow needs before confirming.">
  <img src="https://mintcdn.com/lchnan/gXEJIQXV2JH2VUQJ/product-assets/english-help-2026-09-22/developer-webhook-events-annotated.svg?fit=max&auto=format&n=gXEJIQXV2JH2VUQJ&q=85&s=81cb1ab6ab3e979bb8ad6fdd9c4d4122" alt="YCloud webhook event selector with Search event highlighted." width="3024" height="1656" data-path="product-assets/english-help-2026-09-22/developer-webhook-events-annotated.svg" />
</Frame>

### Parse the return value and verify the signature

#### Parse the return value

Parsing the headers in the webhook response using N8N’s built-in ‘code’ node

<img src="https://mintcdn.com/lchnan/7IqVC2giQEcOq6-5/product-assets/2c273275ba-ishot-2026-04-30-10-50-04.webp?fit=max&auto=format&n=7IqVC2giQEcOq6-5&q=85&s=2ce32f2b7a9148f5c19f291ff87fb4ad" alt="YCloud product screenshot" width="1920" height="993" data-path="product-assets/2c273275ba-ishot-2026-04-30-10-50-04.webp" />

Select JavaScript for parsing

```javascript theme={"theme":{"light":"github-light","dark":"github-dark"}}
function parseSignatureHeader(signatureHeader) {
  const result = {};
  for (const part of (signatureHeader || '').split(',')) {
    const [key, value] = part.split('=');
    if (key && value) {
      result[key.trim()] = value.trim();
    }
  }
  return result;
}

const input = $input.first().json;
const headers = input.headers || {};
const body = input.body;

const signatureHeader = headers['ycloud-signature'] ;
const parsed = parseSignatureHeader(signatureHeader);

const timestamp = parsed.t;
const receivedSignature = parsed.s;

const payload =
  body === undefined || body === null
    ? ''
    : typeof body === 'string'
      ? body
      : JSON.stringify(body);

const signedPayload = `${timestamp}.${payload}`;

return [
  {
    json: {
      ...input,
      timestamp,
      receivedSignature,
      payload,
      signedPayload,
      signatureHeader,

    }
  }
];
```

The return values of this node are:

* The original value,
* The timestamp,
* The received signature, the payload, the signed payload, and the signature information in the request header

#### Encrypted data

In the previous step, the data was fully partitioned. In this node, we will use SignedPayload and Secret. We will use the Crypto node to encrypt the data.

<img src="https://mintcdn.com/lchnan/7IqVC2giQEcOq6-5/product-assets/304e08d482-ishot-2026-04-30-10-52-06.webp?fit=max&auto=format&n=7IqVC2giQEcOq6-5&q=85&s=ef80f4acfb29d1a6ac4db24fbcb9d958" alt="YCloud product screenshot" width="1920" height="993" data-path="product-assets/304e08d482-ishot-2026-04-30-10-52-06.webp" />

Ge Secret from YCloud platform.

<img src="https://mintcdn.com/lchnan/PCdfO4VGvgYoGyQM/product-assets/f3c6c5acc3-ishot-2026-04-30-11-24-02.webp?fit=max&auto=format&n=PCdfO4VGvgYoGyQM&q=85&s=1217648ce39e95778e3a1079aec84c13" alt="YCloud product screenshot" width="2940" height="604" data-path="product-assets/f3c6c5acc3-ishot-2026-04-30-11-24-02.webp" />

#### Compare signatures

Use an if statement to verify the signature information; if it matches, the verification is considered successful.

<img src="https://mintcdn.com/lchnan/AlSk34JesCiO_ZYy/product-assets/e3c383a5bb-ishot-2026-04-30-10-54-22.webp?fit=max&auto=format&n=AlSk34JesCiO_ZYy&q=85&s=2ee80efbbc283a3fe1390d3e82ff4c95" alt="YCloud product screenshot" width="1920" height="993" data-path="product-assets/e3c383a5bb-ishot-2026-04-30-10-54-22.webp" />

#### Reply to messages using AI

Once you have subscribed to the `whatsapp.inbound_message.received` and `whatsapp.message.updated` events, you will receive a push notification when a message is received, or a follow-up status update after a message has been sent.

1. Use the `switch` node to configure multiple webhook notification types.

<img src="https://mintcdn.com/lchnan/RN4tXfXENVvDu0Te/product-assets/b3c1737815-ishot-2026-04-30-16-25-41.webp?fit=max&auto=format&n=RN4tXfXENVvDu0Te&q=85&s=9e974b4c366f72c61bfae9bfbd37ce00" alt="YCloud product screenshot" width="1920" height="993" data-path="product-assets/b3c1737815-ishot-2026-04-30-16-25-41.webp" />

2. When an `inbound_message_received` event is received, a reply can be generated by calling the AI API

<img src="https://mintcdn.com/lchnan/WD-ixrYVrqB7b7aQ/product-assets/50e1d1e086-ishot-2026-04-30-16-28-07.webp?fit=max&auto=format&n=WD-ixrYVrqB7b7aQ&q=85&s=ded17a4e52f2fbc1a0ca65475b14424d" alt="YCloud product screenshot" width="1920" height="993" data-path="product-assets/50e1d1e086-ishot-2026-04-30-16-28-07.webp" />

3. Use the merge node to retain the collection of webhook push data from the preceding section

<img src="https://mintcdn.com/lchnan/9zlgZMZStxEKrVPM/product-assets/09afdc4376-ishot-2026-04-30-16-28-24.webp?fit=max&auto=format&n=9zlgZMZStxEKrVPM&q=85&s=aff24c2139549e797167523c027732d1" alt="YCloud product screenshot" width="571" height="517" data-path="product-assets/09afdc4376-ishot-2026-04-30-16-28-24.webp" />

4. Sending messages using YCloud nodes

<img src="https://mintcdn.com/lchnan/WD-ixrYVrqB7b7aQ/product-assets/4c8c3181d3-ishot-2026-04-30-16-34-48.webp?fit=max&auto=format&n=WD-ixrYVrqB7b7aQ&q=85&s=0a5b33d46797eead0c71665dadf4b640" alt="YCloud product screenshot" width="1047" height="862" data-path="product-assets/4c8c3181d3-ishot-2026-04-30-16-34-48.webp" />

Fill in the relevant details, place the AI-generated text in the Body field, and send.

<Warning>
  Please note that the sender and recipient are **reversed** here; this is a reply message.
</Warning>

With that, the complete n8n workflow—Webhook → Large Language Model → Automated Reply—is now configured.

### Save to a data table (optional)

<img src="https://mintcdn.com/lchnan/PCdfO4VGvgYoGyQM/product-assets/facf991e02-ishot-2026-04-30-17-17-34.webp?fit=max&auto=format&n=PCdfO4VGvgYoGyQM&q=85&s=c31f86a044a3198ac01f4df4bb1c61fb" alt="YCloud product screenshot" width="710" height="916" data-path="product-assets/facf991e02-ishot-2026-04-30-17-17-34.webp" />

### Monitor subsequent updates to the message sent (optional)

Once step 5 is complete, the data will be pushed via the `whatsapp.message.update` event.

Upon receiving this push, you can use the `datatable - update rows` node to update the data table, thereby tracking the entire message delivery process.

<img src="https://mintcdn.com/lchnan/RN4tXfXENVvDu0Te/product-assets/d71c29cf5b-image-20260430172030545.webp?fit=max&auto=format&n=RN4tXfXENVvDu0Te&q=85&s=6e9c7f56be24cde01e3a56489add9c9c" alt="YCloud product screenshot" width="652" height="574" data-path="product-assets/d71c29cf5b-image-20260430172030545.webp" />

<img src="https://mintcdn.com/lchnan/6CxA7mK2t7klNAOL/product-assets/a35824b7cb-image-20260430172039734.webp?fit=max&auto=format&n=6CxA7mK2t7klNAOL&q=85&s=831e5308b4b34776bb5416220faa1878" alt="YCloud product screenshot" width="644" height="652" data-path="product-assets/a35824b7cb-image-20260430172039734.webp" />


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