Prerequisite: You must call
media/createContainer first to obtain a
creationId. Connect the success port of that node into this node's
creationId field.
When to Use
- Immediate publish: After container creation succeeds, connect directly to this node to publish the post immediately to the Instagram feed.
- Scheduled publishing: Store the
creationId in a workflow variable or database, then trigger this node at the scheduled publish time via a timer or calendar event.
- Approval-gated publishing: A content manager approves a post in your CMS, which triggers a workflow that calls
media/publish with the stored creationId.
- Batch campaign launch: At campaign start time, publish multiple pre-created containers in a loop, storing the returned media IDs for performance tracking.
- A/B test post timing: Create identical containers, then publish one at optimal posting time A and another at time B, comparing engagement via
media/get later.
Configuration
Connection
| Field | Required | Description |
accessToken | Required | Long-lived Instagram access token stored in BizFirst Credentials Manager. |
igUserId | Required | Your Instagram Business/Creator account ID (numeric string). |
Operation
| Field | Required | Description |
resource | Required | Must be media. |
operation | Required | Must be publish. |
creationId | Required | Container ID returned by media/createContainer. Use {{ $output.instagram.creationId }} to reference the previous node's output. |
Container expiry: Containers expire 24 hours after creation. If you attempt to publish an expired container, the operation fails with a Graph API error. Re-run media/createContainer to create a fresh container.
Sample Configuration JSON
{
"resource": "media",
"operation": "publish",
"accessToken": "{{ $credential.instagram.accessToken }}",
"igUserId": "17841400000000000",
"creationId": "{{ $output.createContainer.instagram.creationId }}"
}
Validation Errors
| Error | Cause |
accessToken is required | accessToken field is missing or empty. |
igUserId is required | igUserId field is missing or empty. |
creationId is required | creationId field is missing or empty. |
| Graph API error 9007 | Container is still being processed (video). Retry after a short delay. |
| Graph API error 190 | Access token expired or invalid. |
Output
Success Port
| Field | Type | Description |
status | string | "success" |
mediaId | string | Published Instagram media object ID. Use with media/get to retrieve post details. |
payload | string | Raw JSON response from the Graph API. |
Error Port
| Field | Type | Description |
status | string | "error" |
errorCode | string | Graph API error code. |
errorMessage | string | Error description. |
payload | string | Raw error response. |
Sample Output JSON
{
"status": "success",
"mediaId": "17855590000000099",
"payload": "{\"id\":\"17855590000000099\"}"
}
Expression Reference
| Expression | Value |
{{ $output.instagram.mediaId }} | Published media object ID |
Node Policies & GuardRails
- Idempotency: Publishing is not idempotent. Calling publish twice with the same
creationId results in an error on the second call (container already published). Handle the error port to detect duplicate publish attempts.
- Daily publish limit: Instagram limits accounts to 25 API-published posts per 24-hour period. Monitor publish counts in your workflow to avoid hitting this limit.
- Video readiness: Video containers require processing time before they can be published. If you receive error 9007 (container not ready), implement a retry with exponential backoff — typical wait is 30 seconds to 5 minutes.
- Rate limit: 200 calls per user per hour. Each publish call consumes one quota unit.
Examples
Standard image publish (two-step flow)
// Node 1: media/createContainer
{
"resource": "media",
"operation": "create-container",
"accessToken": "{{ $credential.instagram.accessToken }}",
"igUserId": "17841400000000000",
"mediaType": "IMAGE",
"imageUrl": "https://cdn.yourbrand.com/campaigns/spring2025.jpg",
"caption": "Spring has arrived! New arrivals are here. #spring2025"
}
// Node 2: media/publish (receives creationId from Node 1)
{
"resource": "media",
"operation": "publish",
"accessToken": "{{ $credential.instagram.accessToken }}",
"igUserId": "17841400000000000",
"creationId": "{{ $output.node1.instagram.creationId }}"
}
Scheduled publish — retrieve stored creationId
{
"resource": "media",
"operation": "publish",
"accessToken": "{{ $credential.instagram.accessToken }}",
"igUserId": "{{ $env.IG_USER_ID }}",
"creationId": "{{ $db.scheduledPosts.where(id=$input.postId).creationId }}"
}
Triggered by a scheduled workflow. The creationId was stored in the database when the post was created earlier in the day, and is now retrieved at publish time.