Skip to main content

Overview

This is a complete, turn-Feishu-Bitable-into-an-image-production-line workflow: operators fill prompt + reference attachments in a row, attachments auto-convert to OSS URLs, a Coze workflow then calls Nano Banana Pro, and finally the generated image lands back in the row as an attachment — zero code touches required from the user. The author (Shuaila1996) consolidated this from real production use; it includes 3 independent-but-cooperating pieces: a Feishu field shortcut, an Aliyun Function Compute function, and a Coze plugin. Feishu Bitable AI image generation architecture
Project Info
  • 📦 Form: Shared as a code package (not published on GitHub)
  • 👤 Author: Shuaila1996
  • 🎯 Use case: Feishu Enterprise Bitable + Aliyun + Coze CN
  • 🔌 Model: gemini-3-pro-image-preview (Nano Banana Pro, via APIYI)
  • 📝 Full source for the Feishu shortcut and Aliyun function is embedded in this doc; the Coze plugin source is in Nano Banana Pro Coze Plugin

Core Features

Bitable as the workbench

Operators fill prompts and upload reference images in Feishu Bitable — no code, no workflow editor

Auto attachment → OSS

A custom Feishu field shortcut downloads the binary, forwards it to Aliyun FC, which compresses and uploads to OSS

Per-user multi-key

The Coze workflow includes a “per-user API key” dictionary that routes APIYI keys per caller — for clean usage accounting

Batch generation

Bitable’s native batch row operations + the field shortcut = one click to generate dozens to hundreds of images

Direct row write-back

The OSS URL returned from Coze is written back via Feishu’s official “URL → attachment” shortcut, displayed inline as an image attachment

Clear error feedback

Moderation failures, refusals, timeouts come back as friendly text in the row, easy to triage

Supported APIYI Models

Architecture

Deployment Steps

1

Step 1: Aliyun infrastructure

  1. Provision an OSS bucket; create a RAM sub-account with oss:PutObject and oss:ProcessObject permissions
  2. Provision Function Compute (FC); create an HTTP-triggered function on Node.js 18+
  3. Install dependency: ali-oss
  4. Configure environment variables (never hardcode keys):
Aliyun Function Compute configuration
2

Step 2: Deploy the Aliyun FC function

Drop the author’s aliyun-fc-oss-upload.js into your FC function. The function:
  • Receives the binary forwarded from the Feishu shortcut
  • Uploads the original via client.put
  • Saves a compressed copy via client.processObjectSave (long-edge 4500 / quality 95)
  • Wraps the compressed public URL in a feishuWrapper structure that Feishu can parse
Note the function’s public trigger URL when done.
3

Step 3: Build the Feishu field shortcut

Use the Feishu field shortcut framework to deploy feishu-attachment-to-oss.ts. Two replacements:
Feishu field shortcuts run inside Feishu’s official sandbox where many Node.js libraries are unavailable, so attachment upload must be split into “shortcut downloads binary → FC uploads to OSS”. You can’t call the OSS SDK directly from the shortcut.
Package and submit to Feishu’s official team to upload to your enterprise shortcut library.
4

Step 4: Configure Feishu Bitable fields

Set up these fields in your Bitable:Formula example for Merged prompt:
5

Step 5: Deploy the Coze plugin and workflow

  1. Deploy the Python plugin per Nano Banana Pro Coze Plugin
  2. Import the author’s Coze workflow export, which includes:
    • A code node to split images and prompt
    • A “per-user API key” dictionary node (caller name → APIYI key)
    • The Nano Banana Pro plugin node
    • Success / failure / error aggregation
  3. Maintain the “per-user API key” dictionary inside the workflow
6

Step 6: Wire up Feishu's Coze workflow shortcut

Add either Feishu’s official or a custom “Coze workflow call” field shortcut to the Bitable, configured as below:Feishu Coze workflow call configurationKey points:
  • Fill in the workflow token and workflow ID from Coze
  • Field names in the request template must exactly match Coze workflow input names
  • Required fields follow Coze workflow’s required flag
  • The apichoice column should hold apiyi, not display strings like apiyi(0.35元/张) — the dictionary lookup will fail otherwise
7

Step 7: URL → attachment to render results

Last step: convert the URL Coze returns into a Feishu image attachment. Two options:
  1. Buy directly: use the official Coze “URL → attachment” field shortcut
  2. Build your own: implement a custom URL-to-attachment field shortcut following the Feishu doc

Bitable Merge Formula

The “Merged prompt” formula in Bitable:
CHAR(10) is a newline, letting the Coze code node split prompt vs. image URLs by \n.

Feishu Field Shortcut Full Source

Below is the complete feishu-attachment-to-oss.ts, ready to drop into the Feishu field-shortcut framework. Before deploying, only the two feishu-service placeholders need replacing with your Aliyun FC public domain / URL.
feishu-attachment-to-oss.ts

Aliyun Function Compute Full Source

Below is the complete aliyun-fc-oss-upload.js, ready to paste into Aliyun Function Compute (Node.js 18+). All credentials are read from environment variables — never hardcode.
The function returns a feishuWrapper(...) double-layer structure: the HTTP layer always returns 200 (so Feishu’s fetch doesn’t throw on non-2xx); the real status and payload sit inside body (a JSON string), which Feishu unwraps with JSON.parse(result.body).
aliyun-fc-oss-upload.js

Coze Plugin Source

The Python plugin coze-nanobanana-pro.py is fully embedded in Nano Banana Pro Coze Plugin under the “Plugin Full Source” section — copy and paste, no separate download.

Security Notes

This stack involves API keys, Aliyun AccessKey, Feishu tokens, Coze tokens — multiple credentials. Always:
  1. Never hardcode keys: Aliyun FC uses env vars, Coze uses platform encrypted config, Feishu shortcut wipes real URLs before commit
  2. OSS sub-account, minimum permissions: only oss:PutObject + oss:ProcessObject on the target bucket, never global
  3. Distribute APIYI keys per person: use the per-user dictionary, easy to audit and revoke
  4. Sign the FC public trigger: enable signature auth on the Function Compute trigger to block external misuse

FAQ

Two checks:
  1. Is the FC public domain in basekit.addDomainList (without https://)?
  2. Is context.fetch using the full https:// URL?
Feishu’s sandbox blocks any domain you haven’t declared.
Check first:
  • Does the apichoice column hold apiyi (not display strings like apiyi(0.35元/张))?
  • Is the caller listed in the “per-user API key” dictionary?
  • Does the caller’s name match the Bitable person field exactly (whitespace, simplified vs. traditional)?
Coze returns a text URL by default; Feishu needs another “URL → attachment” shortcut to render. Either:
  1. Buy Coze’s official “URL → attachment” shortcut (easiest)
  2. Build your own URL-to-attachment shortcut
Usually processObjectSave parameter or bucket region mismatch. Check:
  • Is image processing enabled on the bucket?
  • Does process.env.OSS_REGION match the bucket’s actual region?
  • Does the RAM sub-account have oss:ProcessObject permission?
Nano Banana Pro 4K is slow. Recommended:
  • Add concurrency limits at the Coze workflow entry
  • Trigger field shortcuts in Bitable in batches of 5–10 rows at a time
  • Distribute different APIYI keys across callers to spread out rate limits
Yes — every piece is embedded in the docs (contributed by Shuaila1996), copy-paste ready:
  • feishu-attachment-to-oss.ts (Feishu field shortcut) → see “Feishu Field Shortcut Full Source” above on this page
  • aliyun-fc-oss-upload.js (Aliyun FC) → see “Aliyun Function Compute Full Source” above on this page
  • coze-nanobanana-pro.py (Coze plugin) → see “Plugin Full Source” in Nano Banana Pro Coze Plugin

Nano Banana Pro Coze Plugin

The companion Coze plugin code and detailed guide — also useful standalone for any Coze workflow that needs Nano Banana Pro

Nano Banana Pro Doc

Full API doc, pricing, and generation samples

Image generation failure FAQ

Nano Banana failure-troubleshooting guide

APIYI Console

Manage API keys, view usage and balance