Run Gemma 4 locally with Ollama, connect it to a self-hosted n8n workflow, and give it a one-page brand brief. Each week it drafts Facebook and Instagram posts, sends them to you for approval on Telegram, and publishes the approved ones through Meta’s official Graph API. The software and the API cost nothing.
Key takeaways
Gemma 4 supports native tool calling, so it can act as an agent
You need an Instagram Business or Creator account and a free Meta developer app
No App Review is needed when you publish only to your own accounts
Keep human approval on, and refresh your access token before 60 days

The example: a yoga studio with no time to post
Mei runs a yoga studio in Singapore. She wants five posts a week across Facebook and Instagram, and she never has time to write them. The agent below works like an intern: it drafts on Sunday, she approves on Monday, and nothing goes out without her tap.
Step 1: Install the brain
Install Ollama, then pull Gemma 4. Use ollama pull gemma4:e4b on a 16 GB machine or gemma4:e2b on 8 GB. Gemma 4 can call tools natively, which lets it return structured posts and trigger the next step in a workflow.
Step 2: Set up the workbench
Install n8n on the same computer (via npm or Docker). It’s a workflow tool with ready nodes for Ollama, Telegram and HTTP calls to Meta. Self-hosting is free for your own business’s use under n8n’s Sustainable Use License.
Step 3: Write the brand brief
Keep it to one page: tone of voice, classes or products, current offers, posting days, and words or claims to avoid. Store it in the workflow so every run starts from the same brief.
Step 4: Connect Meta
Switch Instagram to a Business or Creator account and link it to your Facebook Page. Create an app at Meta for Developers and request the publishing permissions. Standard Access works for accounts where you have a role on the app, so App Review isn’t needed for your own brand. Exchange the short-lived token for a long-lived one, which lasts 60 days, and set a reminder to refresh it.
Step 5: Build the weekly run
A schedule node fires every Sunday.
Gemma reads the brief and returns five posts as structured data, each with a caption, hashtags and an image idea.
n8n sends each draft to Telegram and waits for Approve or Reject.
Approved Instagram posts follow Meta’s two-step flow: create a media container from a public JPEG URL, then publish it. Facebook posts go to your Page’s photos or feed endpoint.
Step 6: Learn every Friday
Pull post insights through the API, pass them to Gemma, and ask for a short note on what worked and one change for next week.
Limits to know
Instagram images must be JPEG files at a public URL, at most 8 MB.
Publishing quotas apply per account. Check the live number with the content_publishing_limit endpoint.
Your computer must be on when the workflow runs.
A small local model can get facts wrong, so read every draft.
Don’t automate likes, follows, comment replies or DMs.
Frequently asked questions
Trending question: Can I automate Instagram posts for free?
Yes. Meta’s Graph API is free for Business and Creator accounts. Paired with self-hosted n8n and a local model like Gemma 4, the software costs nothing.
Trending question: Can Gemma 4 run an AI agent on a normal laptop?
Yes. The smaller Gemma 4 sizes run through Ollama on 8–16 GB of RAM and support tool calling, which is enough for drafting and workflow tasks.
Do I need Meta App Review to post with the API?
Not for your own accounts. App Review and Business Verification are needed to publish for accounts you don’t own.
Will the agent get my account banned?
Using the official API with human approval is the safe route. Fake engagement, mass DMs or unofficial bots are what put accounts at risk.
-
Writen by Anirban Das
USA:
India: