write-pipeline
Skill này làm gì
Skill này giải thích cách xây dựng pipeline dữ liệu trong Windmill từ các script riêng biệt được liên kết bằng lưu trữ dùng chung và trigger, thay vì một flow. Nó dành cho người di chuyển và biến đổi dữ liệu từng bước.
Khi nào nên dùng
- ✓Khi bạn muốn nạp, biến đổi hoặc vật hóa dữ liệu qua nhiều bước trong Windmill.
- ✓Khi bạn yêu cầu một pipeline dữ liệu thay vì một flow đơn lẻ.
- ✓Khi một bảng nên được tạo bởi script DuckDB ghi vào bảng DuckLake.
Liên kết skill
https://github.com/windmill-labs/windmill/blob/main/system_prompts/auto-generated/skills/write-pipeline/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Xây một pipeline Windmill nạp file CSV bán hàng của chúng tôi vào một bảng, rồi tạo một bảng tóm tắt hàng tháng.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Skill yêu cầu agent viết các script nhỏ, mỗi script được đánh dấu bằng ghi chú về những gì nó đọc và ghi, để chế độ xem pipeline của Windmill liên kết chúng lại.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
Data pipeline authoring
A data pipeline is NOT a flow. A flow is one runnable that orchestrates steps internally. A data pipeline is a set of independent scripts, each deployed on its own, that form a DAG by reading and writing shared storage assets (DuckLake tables, data tables, S3 objects, volumes, resources) and by declaring execution triggers. The pipeline is visualized and edited at /pipeline/<folder>; every node is a normal workspace script that happens to carry pipeline annotations. When the user asks for a "data pipeline" (or to "ingest / transform / materialize" data across steps), build pipeline-annotated scripts — do NOT build a flow.
Default to DuckDB + DuckLake
A pipeline node that produces a table should almost always be a duckdb node that materializes its output into a DuckLake table with -- materialize ducklake://<name>/<table> (in a DuckDB node the annotation uses SQL -- comment syntax; write the body as a bare SELECT and let the runtime do the write). DuckLake is the default lakehouse store for pipelines and is the shape the pipeline editor is built around, so prefer it unless the work specifically calls for something else:
postgresql/ data tables — only for row-level, OLTP-style mutations against an existing Postgres data table (frequent single-row upserts/updates, transactional reads that an app queries live).bun/python3— only for work that doesn't map to SQL: calling an external API, wrangling files, arbitrary glue. When such a node produces tabular data for downstream steps, write it straight into DuckLake (or a data table) from the same script — see "Ingesting from Python / TypeScript" below — rather than inventing a parallel store.
Do not spread a pipeline across postgres, S3, and DuckLake when one DuckLake lake would do; a consistent DuckLake lakehouse is the goal.
Ingesting from Python / TypeScript
A node that fetches data in code (an API, a SaaS export, a scraper) writes the rows directly into their DuckLake table with wmill.ducklake(), or into a data table with wmill.datatable(). DuckLake already stores every table as parquet files in the workspace object storage, so never stage the raw payload first — no intermediate JSON / CSV / parquet file in S3 and no second "load the raw file" node. One ingestion node, one table.
Pass the rows as a query argument (a list of dicts / array of objects is sent as JSON) and let SQL unnest them; declare the column types so the table gets a real schema:
# pipeline
# on schedule
import wmill
def main():
rows = fetch_charges() # list[dict]
lake = wmill.ducklake()
lake.query("""
CREATE OR REPLACE TABLE stripe_charges AS
SELECT unnest(from_json($rows, '[{"id":"VARCHAR","amount":"BIGINT","created":"BIGINT"}]'), recursive := true)
""", rows=rows).fetch()
// pipeline
// on schedule
import * as wmill from "windmill-client"
export async function main() {
const rows = await fetchCharges()
const lake = wmill.ducklake()
await lake`CREATE OR REPLACE TABLE stripe_charges AS
SELECT unnest(from_json(${rows}, '[{"id":"VARCHAR","amount":"BIGINT","created":"BIGINT"}]'), recursive := true)`.fetch()
}
- Use
INSERT INTO <table> SELECT ...instead ofCREATE OR REPLACEto append (an incremental pull), with a one-timeCREATE TABLE IF NOT EXISTSfirst. - Assign the client to a variable (
lake = wmill.ducklake()) and keep the SQL a string literal (Python) or a template withoutsql.raw(TS): that is what lets the graph record the node's write toducklake://main/<table>. A chainedwmill.ducklake().query(...)or SQL built in a variable records no output, so the downstream edge never forms. wmill.ducklake("<name>")targets a non-default catalog;wmill.datatable("<name>")writes a Postgres data table the same way (Pythondb.query(sql, *args)with$1placeholders, TS the same template form) — use it only when the data belongs in Postgres (see above).- The downstream node triggers on the table itself:
-- on ducklake://main/stripe_charges.
Storage prerequisites
A DuckLake pipeline only runs once the workspace has object storage (S3 / Azure Blob / GCS) and a DuckLake catalog configured — DuckLake tables and s3:// assets can't be materialized or read without it. Check which DuckLake catalogs the workspace has before you build.
wmill ducklake list lists them.
Drafting the annotated scripts does not
Câu hỏi thường gặp
Pipeline dữ liệu có giống flow không?
Không. Pipeline là tập các script riêng biệt được liên kết qua bảng dùng chung, còn flow chạy các bước của nó bên trong một runnable.
DuckLake là gì?
Đó là kho bảng lakehouse mà skill dùng mặc định cho đầu ra của pipeline.
Tôi xem pipeline ở đâu?
Windmill hiển thị nó trong trình soạn thảo pipeline cho thư mục chứa các script.
Chi tiết
Mô tả gốc của tác giả
MUST use when creating or modifying a data pipeline, a set of scripts marked `pipeline` and wired together by `on` / `materialize` annotations.
repo: windmill-labs/windmill
Độ phổ biến
- Sao GitHub
- 18k
- Vị trí xếp hạng
- #10632
- Giấy phép
- —
- Cập nhật
- 2/11/2026
Bình luận
- …
Thêm skill từ kho mã này
commit
18kGiúp agent của bạn viết commit message git gọn một dòng theo định dạng quy ước, chỉ stage những file đã thay đổi.
pr
18kGiúp agent của bạn mở một pull request nháp trên GitHub với tiêu đề và mô tả rõ ràng, rồi theo dõi các vòng review.
agents
18kGiúp agent của bạn xây dựng một agent AI Windmill có thể tái sử dụng, với model, system prompt, công cụ và bộ nhớ riêng.
cli-commands
18kGiúp agent của bạn chạy công cụ dòng lệnh Windmill để quản lý script, flow, app và lịch sử job.
Skill tương tự
discrawl
394kCho phép agent của bạn tìm kiếm và tóm tắt kho lưu trữ tin nhắn Discord trên máy, kiểm tra độ mới của dữ liệu và đọc tin nhắn trực tiếp.
clickhouse-io
280kGiúp agent của bạn tối ưu truy vấn và schema trong ClickHouse theo thực hành tốt nhất cho phân tích dữ liệu hiệu năng cao khi truy vấn chậm.
scientific-db-pubmed-database
280kGiúp agent của bạn tìm bài báo khoa học trong lĩnh vực y sinh. Hữu ích cho nghiên cứu cần thông tin y khoa cụ thể.