salesforce-flow-design
Fungsinya
Panduan ini membantu Anda membangun flow otomatisasi Salesforce dengan benar dan aman. Panduan ini mengajarkan cara memilih jenis flow yang tepat, menghindari kesalahan umum, dan memastikan otomatisasi berjalan baik, bahkan dengan data dalam jumlah besar.
Kapan dipakai
- βSaat memulai flow otomatisasi baru.
- βSaat meninjau flow yang sudah ada untuk memastikan strukturnya sudah baik.
- βSaat sebuah flow menyebabkan error atau tidak berjalan sesuai harapan.
Link skill
https://github.com/github/awesome-copilot/blob/main/skills/salesforce-flow-design/SKILL.mdSalin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.
Cara pakai
Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.
Pesan siap tempel
Untuk Claude Code, Codex, atau Cursor: jalankan di folder proyek, lalu skill langsung terpasang.
Unduh SKILL.md lalu taruh di folder skill agen Anda.
Contoh permintaan ke AI
βBagaimana cara memastikan flow penjualan saya tidak crash jika banyak pelanggan diperbarui sekaligus?β
5 skill baru setiap minggu. 1 menit baca.
Cara kerjanya
Panduan ini memeriksa apakah Anda sudah memilih jenis flow yang tepat untuk kebutuhan Anda dan apakah flow sudah diatur untuk menangani banyak record data sekaligus. Panduan ini juga menunjukkan cara menambahkan perlindungan terhadap error.
Konten teknis (SKILL.md asli)
Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.
Salesforce Flow Design and Validation
Apply these checks to every Flow you design, build, or review.
Step 1 β Confirm Flow Is the Right Tool
Before designing a Flow, verify that a lighter-weight declarative option cannot solve the problem:
| Requirement | Best tool |
|---|---|
| Calculate a field value with no side effects | Formula field |
| Prevent a bad record save with a user message | Validation rule |
| Sum or count child records on a parent | Roll-up Summary field |
| Complex multi-object logic, callouts, or high volume | Apex (Queueable / Batch) β not Flow |
| Everything else | Flow β |
If you are building a Flow that could be replaced by a formula field or validation rule, ask the user to confirm the requirement is genuinely more complex.
Step 2 β Select the Correct Flow Type
| Use case | Flow type | Key constraint |
|---|---|---|
| Update a field on the same record before it is saved | Before-save Record-Triggered | Cannot send emails, make callouts, or change related records |
| Create/update related records, emails, callouts | After-save Record-Triggered | Runs after commit β avoid recursion traps |
| Guide a user through a multi-step UI process | Screen Flow | Cannot be triggered by a record event automatically |
| Reusable background logic called from another Flow | Autolaunched (Subflow) | Input/output variables define the contract |
Logic invoked from Apex @InvocableMethod |
Autolaunched (Invocable) | Must declare input/output variables |
| Time-based batch processing | Scheduled Flow | Runs in batch context β respect governor limits |
| Respond to events (Platform Events / CDC) | Platform EventβTriggered | Runs asynchronously β eventual consistency |
Decision rule: choose before-save when you only need to change the triggering record's own fields. Move to after-save the moment you need to touch related records, send emails, or make callouts.
Step 3 β Bulk Safety Checklist
These patterns are governor limit failures at scale. Check for all of them before the Flow is activated.
DML in Loops β Automatic Fail
Loop element
βββ Create Records / Update Records / Delete Records β β DML inside loop
Fix: collect records inside the loop into a collection variable, then run the DML element outside the loop.
Get Records in Loops β Automatic Fail
Loop element
βββ Get Records β β SOQL inside loop
Fix: perform the Get Records query before the loop, then loop over the collection variable.
Correct Bulk Pattern
Get Records β collect all records in one query
βββ Loop over the collection variable
βββ Decision / Assignment (no DML, no Get Records)
βββ After the loop: Create/Update/Delete Records β one DML operation
Transform vs Loop
When the goal is reshaping a collection (e.g. mapping field values from one object to another), use the Transform element instead of a Loop + Assignment pattern. Transform is bulk-safe by design and produces cleaner Flow graphs.
Step 4 β Fault Path Requirements
Every element that can fail at runtime must have a fault connector. Flows without fault paths surface raw system errors to users.
Elements That Require Fault Connectors
- Create Records
- Update Records
- Delete Records
- Get Records (when accessing a required record that might not exist)
- Send Email
- HTTP Callout / External Service action
- Apex action (invocable)
- Subflow (if the subflow can throw a fault)
Fault Handler Pattern
Fault connector β Log Error (Create Records on a logging object or fire a Platform Event)
β Screen element with user-friendly message (Screen Flows)
β Stop / End element (Record-Triggered Flows)
Never connect a fault path back to the same element that faulted β this creates an infinite loop.
Step 5 β Automation Density Check
Before deploying, verify there are no overlapping automations on the same object and trigger event:
- Other active Record-Triggered Flows on the same
Object+When to Runcombination - Legacy Process Builder rules still active on the same object
- Workflow Rules that fire on the same field changes
- Apex triggers that also run on the same
before insert/after updatecontext
Overlapping automations can cause unexpected ordering, recursion, and governor limit failures. Document the automation inventory for the object before activating.
Step 6 β Screen Flow UX Guidelines
β¦
Pertanyaan umum
Apa itu 'flow' di Salesforce?
Ini adalah alat yang mengotomatisasi tugas berulang di Salesforce, seperti memperbarui informasi pelanggan atau mengirim email, tanpa perlu menulis kode.
Mengapa 'DML in Loops' menjadi masalah?
Melakukan suatu aksi (seperti menyimpan data) berulang kali di dalam daftar item sangat lambat dan dapat membuat sistem crash karena menghabiskan terlalu banyak sumber daya.
Apa itu 'fault connectors'?
Ini adalah jalur alternatif yang diambil flow saat terjadi kesalahan, sehingga flow dapat mencatat error atau memberi tahu pengguna dengan baik, alih-alih langsung berhenti.
Detail
Deskripsi asli dari pembuat
Salesforce Flow architecture decisions, flow type selection, bulk safety validation, and fault handling standards. Use this skill when designing or reviewing Record-Triggered, Screen, Autolaunched, Scheduled, or Platform Event flows to ensure correct type selection, no DML/Get Records in loops, proper fault connectors on all data-changing elements, and appropriate automation density checks before
repo: github/awesome-copilot
Popularitas
- Bintang GitHub
- 40k
- Peringkat
- #7414
- Lisensi
- MIT
- Diperbarui
- 15/10/2026
Komentar
- β¦
Skill lain dari repositori ini
acquire-codebase-knowledge
40kMembantu agent Anda memahami dan mendokumentasikan proyek kode yang sudah ada. Berguna untuk proses onboarding anggota baru atau mendapatkan gambaran arsitektur.
acreadiness-assess
40kMemungkinkan agent Anda menilai kesiapan proyek untuk AI dan membuat laporannya. Berguna untuk mengetahui seberapa siap proyek menggunakan alat AI.
acreadiness-generate-instructions
40kMembantu agent Anda membuat instruksi untuk alat AI berdasarkan hasil penilaian. Berguna untuk meningkatkan cara AI berinteraksi dengan kode dan menutup celah yang ditemukan.
acreadiness-policy
40kMemungkinkan agent Anda membantu menyusun atau menerapkan kebijakan untuk penilaian proyek AI. Berguna untuk menstandarisasi evaluasi proyek dan memastikan kepatuhan.
Skill serupa
api-connector-builder
280kMembuat agent Anda membangun koneksi API baru mengikuti pola yang sudah ada. Gunakan saat ingin menambah integrasi lagi tanpa membuat cara baru.
api-design
280kMembantu agent Anda merancang REST API sesuai praktik terbaik. Berguna untuk mengatur cara API berkomunikasi, menampilkan error, dan mengorganisasi data.
backend-patterns
280kMembantu agent Anda dengan pola arsitektur sisi server dan optimasi database. Berguna untuk membangun atau meninjau kode yang berjalan di server.