Connects to the Instagram Graph API. An agent can publish photo posts, Reels, and Stories, read recent media and comments, reply to/hide/delete comments, send DMs, fetch post insights, and look up public profile info.
This connector's tools are also used by the instagram-send workflow node.
Add to an agent node's tools array with _node_type: "tool-instagram". See Connector Reference — How connectors are used.
Authentication
| Field | Required | Description |
|---|---|---|
access_token | Yes (or token) | Long-lived Page or User access token. |
token | Yes (or access_token) | Used if access_token is not set. |
instagram_account_id | Yes | Instagram Business/Creator account ID. |
{
"name": "instagram",
"_node_type": "tool-instagram",
"access_token": "{{ secret.INSTAGRAM_ACCESS_TOKEN }}",
"instagram_account_id": "{{ secret.INSTAGRAM_ACCOUNT_ID }}"
}
To obtain credentials: create a Meta App at developers.facebook.com, add the "Instagram" product and connect your Instagram Business account, generate a long-lived token via GET /oauth/access_token?grant_type=fb_exchange_token, and find instagram_account_id via GET /me/accounts → Page ID, then GET /{page-id}?fields=instagram_business_account.
Tools
instagram_create_post
Publish a photo post to an Instagram Business or Creator account feed. The image must be a publicly accessible URL.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
image_url | string | Yes | Publicly accessible URL of the image to post (JPEG or PNG) |
caption | string | No | Post caption. Supports hashtags and @mentions (max 2200 chars) |
location_id | string | No | Facebook Page ID of a location to tag (optional) |
alt_text | string | No | Accessibility alt text for the image (optional) |
Returns: A confirmation message with the new media ID and a link to the post.
instagram_create_reel
Publish a Reel (short video) to an Instagram account. The video must be a publicly accessible MP4 URL.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
video_url | string | Yes | Publicly accessible URL of the video file (MP4 H.264 recommended) |
caption | string | No | Reel caption with hashtags and @mentions (max 2200 chars) |
audio_name | string | No | Display name for the audio in Reels (optional) |
Returns: A confirmation message with the new Reel's media ID.
instagram_create_story
Publish a photo or video story to an Instagram account.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
media_url | string | Yes | Publicly accessible URL of image (JPEG/PNG) or video (MP4) for the story |
media_type | string | No | Media type: IMAGE or VIDEO (default IMAGE) |
Returns: A confirmation message with the new media ID and the resolved media type.
instagram_get_media
Retrieve recent media posts (photos, videos, reels) from an Instagram account with engagement metrics.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
limit | number | No | Number of recent posts to return (default 10, max 50) |
Returns: A list of posts, each showing date, media ID, media type, like/comment counts, a truncated caption, and the permalink — or "No media found.".
instagram_get_comments
Get comments on an Instagram media post. Returns commenter username, text, timestamp, and like count.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
media_id | string | Yes | Instagram media ID to get comments for |
limit | number | No | Max comments to return (default 20) |
Returns: A newline-separated list of [date] @username (id: <id>, ❤️<likes>): <text> lines, or "No comments found.".
instagram_reply_comment
Reply to an Instagram comment on a post. The reply will appear as a threaded response.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
comment_id | string | Yes | ID of the comment to reply to |
message | string | Yes | Reply text. Can include @username to mention the commenter |
Returns: A confirmation message with the new reply's ID and the comment it replied to.
instagram_delete_comment
Permanently delete a comment from an Instagram post. Can delete comments on posts owned by the authenticated account.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
comment_id | string | Yes | ID of the comment to delete |
Returns: A confirmation message that the comment was deleted, or an error if the API reports success=false.
instagram_hide_comment
Hide or unhide a comment on an Instagram post. Hidden comments are visible to the commenter but not others.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
comment_id | string | Yes | ID of the comment to hide or unhide |
hide | boolean | No | true to hide the comment from public view, false to unhide it |
Returns: A confirmation message stating the comment was hidden or unhidden, or an error if the API reports success=false.
instagram_send_dm
Send a direct message (DM) to an Instagram user. Only works within the 7-day messaging window (24h standard, 7 days with human agent tag). User must have messaged first.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
recipient_id | string | Yes | Instagram user ID or IGSID of the recipient |
text | string | Yes | Message text to send (max 1000 chars) |
Returns: A confirmation message with the new message ID and recipient user ID.
instagram_get_insights
Get performance insights for an Instagram post: impressions, reach, saves, shares, and profile visits.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
media_id | string | Yes | Instagram media ID to get insights for |
Returns: A list of <metric>: <value> lines (impressions, reach, saved, shares, profile_visits, likes, comments) for the media, or a note that insights are unavailable (account may need Business/Creator status).
instagram_get_user_info
Look up basic profile information for an Instagram user by username: follower count, following count, bio, and post count.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
username | string | Yes | Instagram username to look up (without @) |
Returns: The user's name, bio, follower/following/post counts, and website (via the Business Discovery API), or an error if the user is not found or not a Business/Creator account.