> For the complete documentation index, see [llms.txt](https://help.blotato.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.blotato.com/integrations-and-automation-templates/templates/11-build-your-first-ai-automation.md).

# 11 Build Your First AI Automation

Give this n8n workflow to your AI agent: extract content, generate a visual, review the result, then publish to a selected social account. For Make, follow the [Make setup guide](/integrations-and-automation-templates/make.com.md) and the [async API contract](/api-and-mcp-concepts/workflows.md).

## What You'll Learn

1. Extract content with Source > Create and Source > Get.
2. Render a visual with Visual > Create and Visual > Get.
3. Confirm publication with Post > Publish and Post > Get.

## Video Tutorial

For a recorded workflow, see [1 Post Everywhere](/integrations-and-automation-templates/templates/1-post-everywhere.md). Use the completion checks below when adapting a tutorial.

## Prerequisites

1. [Install the Blotato n8n node and verify its credential](/integrations-and-automation-templates/n8n/n8n-blotato-node.md#configure-and-verify-the-credential).
2. [Connect your social accounts](/settings/social-accounts.md).
3. Select the destination account and any required [Page or board ID](/api-and-mcp-concepts/accounts-and-identifiers.md).
4. Agree on the content, destination, and any [generation credit use](/web-app-features/videos/ai-video-credits.md) before running the workflow.

## Workflow Overview

Each Create or Publish operation starts work. Its response is not proof of completion.

| Operation       | Save this response field | Check with   | Proceed when                                                            |
| --------------- | ------------------------ | ------------ | ----------------------------------------------------------------------- |
| Source > Create | `id`                     | Source > Get | `status` is `completed`. Use `content`.                                 |
| Visual > Create | `item.id`                | Visual > Get | `item.status` is `done`, `item.error` is absent, and output URLs exist. |
| Post > Publish  | `postSubmissionId`       | Post > Get   | `status` is `published`. Read `publicUrl` when returned.                |

Set a waiting limit. If a status request fails or the limit expires, preserve the operation ID and report the unfinished stage. Resume with Get. Do not repeat Create or Publish to recover from an uncertain result.

## Step-by-Step Setup

### Step 1: Add Create Source Node

1. Select Source > Create.
2. Select URL for a supported source URL, Text for supplied content, or AI Research for a query.
3. Submit the source.
4. Save the returned `id`.

### Step 2: Add Wait Node

1. Add a Wait node before Source > Get.
2. Set a 5-second interval between status checks.

This interval is a polling recommendation, not a promised processing time. Account for other workflows sharing the [rate limit](/api-and-mcp-concepts/rate-limits.md).

### Step 3: Add Get Source Node

1. Select Source > Get using the saved source `id`.
2. Inspect `status`.
3. Route `queued` or `processing` back through Wait, within the waiting limit.
4. Stop on `failed` and report `message`.
5. Pass `content` forward only after `completed`.

### Step 4: Add Create Visual Node

1. Select Visual > Create.
2. Choose a template from the [template catalog](/rest-api-reference/visuals.md).
3. Use the extracted content in the prompt or map it to the selected template's input fields.
4. Submit once and save `item.id`.
5. Add a Wait > Visual > Get loop using the saved visual ID.
6. Stop on `item.error`, `creation-from-template-failed`, or `insufficient-credits`.
7. Continue only after `item.status` is `done` and output URLs exist.
8. Review `item.mediaUrl` for a video or `item.imageUrls` for a carousel before publishing.

A `draft` is not a rendered output. Follow [visual generation](/agent-workflows/agent-workflows/visuals.md) if no publishable output is returned. Template input names differ. Image Slideshow with Text Overlays uses `inputs.slides`. AI Story Video uses `inputs.scenes`.

### Step 5: Add Publish Node

1. Confirm the reviewed content and destination are approved for publishing.
2. Select Post > Publish for the selected platform and account.
3. Map the completed visual's output URL or URLs to the media field.
4. Submit once and save `postSubmissionId`.
5. Add a Wait > Post > Get loop using the saved submission ID.
6. Report `published` as success or `failed` with `errorMessage`.

For `in-progress`, continue Get checks within the waiting limit. For `scheduled`, stop immediate polling and report the scheduled result, not a published post. Follow [publication verification](/integrations-and-automation-templates/n8n/n8n-blotato-node.md#verify-a-publication).

## Tips

1. Inspect status and error fields rather than relying on a node's `_hint` text.
2. Keep each operation ID separate from account IDs and template IDs.
3. Follow [publishing diagnosis](/start-with-an-ai-agent/publishing-status.md) after a failed publication.

## Source Types You Can Use

The n8n node offers URL, Text, and AI Research. URL mode infers the source type. Supported formats and extraction restrictions are listed in [Create Source](/rest-api-reference/create-source.md#source-types). Supply Text if your source does not provide a usable transcript.

## Next Steps

1. Review [async workflows](/api-and-mcp-concepts/workflows.md) for request and response examples.
2. Follow [publishing](/agent-workflows/agent-workflows/publish.md) for destination and media checks.
3. Follow [scheduling](/agent-workflows/agent-workflows/schedule.md) for a future publication.


---

# 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://help.blotato.com/integrations-and-automation-templates/templates/11-build-your-first-ai-automation.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.
