flow-orchestrator-2025 について
Apex を使わずに複数ユーザーの業務プロセスを設計するチーム向けの、Salesforce Flow Orchestrator のリファレンススキルです。ユーザータスク、バックグラウンド自動化、承認、障害処理を組み合わせた段階的なワークフローを解説します。
主な機能
- 01複数ユーザーの段階的なワークフロー
- 02対話型ステップとバックグラウンドステップ
- 03条件に応じたステージ実行
- 04リトライ付きの障害パス
- 05進捗追跡とモニタリング
活用シーン
- 01複数チームでの従業員オンボーディング
- 02部門横断の見積もり承認
- 03段階別のサポートケースエスカレーション
- 04プロビジョニング失敗後の復旧
インストール
コマンドをコピーしてターミナルで実行します。
npx skills add https:/ / github.com/ josiahsiegel/ claude-plugin-marketplace --skill flow-orchestrator-2025インストール後、Claude Code で/flow-orchestrator-2025を入力して読み込まれたか確認します。
同梱ファイルreferences/advanced-patterns-monitoring.md
詳細
🚨 重要なガイドライン
Windows のファイルパス要件
必須:Windows ではファイルパスに必ずバックスラッシュを使用してください
Windows で Edit ツールまたは Write ツールを使用する場合、ファイルパスにはスラッシュ(/)ではなく、必ずバックスラッシュ(\)を使用してください。
例:
- ❌ 誤り:
D:/repos/project/file.tsx - ✅ 正しい:
D:\repos\project\file.tsx
これは以下に適用されます。
- Edit ツールの file_path パラメーター
- Write ツールの file_path パラメーター
- Windows システム上でのすべてのファイル操作
ドキュメント作成ガイドライン
ユーザーから明示的に依頼されない限り、新しいドキュメントファイルを作成しないでください。
- 優先事項:新しいドキュメントを作成するのではなく、既存の README.md ファイルを更新してください
- リポジトリの整理:ユーザーから別途依頼されない限り、リポジトリのルートは README.md のみとし、整理された状態を保ってください
- スタイル:ドキュメントは簡潔、明瞭、かつプロフェッショナルにし、AI が生成したような文体は避けてください
- ユーザーの希望:ユーザーがドキュメント作成を明示的に依頼した場合にのみ、追加の .md ファイルを作成してください
Salesforce Flow Orchestrator(2025)
Flow Orchestrator とは?
Flow Orchestrator は、コードを書かずに、複数のユーザーが複数のステップと段階にわたって進めるビジネスプロセスを調整します。複数のユーザーが、承認、条件ロジック、エラー処理を組み込んだ 1 つのワークフローで、順番にタスクを完了します。
主な機能:
- 複数ユーザーのワークフロー:段階をまたいで、異なるユーザーやチームにタスクを割り当てます
- 段階ベースの実行:作業を論理的な段階に整理します
- バックグラウンド自動化:ユーザータスクと自動ステップを組み合わせます
- 視覚的な進捗状況の追跡:ユーザーはワークフロー内の自分の位置を確認できます
- 障害パス:エラーを適切に処理します(Summer '25)
- ノーコード:Apex を使わずに複雑なプロセスを構築します
Flow Orchestrator を使用する場面
| ユースケース | Flow Orchestrator? | 理由 |
|---|---|---|
| 従業員のオンボーディング(人事 → IT → マネージャー) | ✅ はい | 複数ユーザーによる順次処理の段階 |
| 見積もりから入金まで(営業 → 財務 → 運用) | ✅ はい | 部門横断的な承認プロセス |
| ケースのエスカレーション(L1 → L2 → L3 サポート) | ✅ はい | SLA に基づく段階的な割り当て |
| シンプルなレコードの自動化(作成/更新) | ❌ いいえ | レコードトリガーフローを使用します |
| 単一ユーザーのプロセス | ❌ いいえ | 画面フローを使用します |
| バッチデータ処理 | ❌ いいえ | スケジュールフローまたは Apex Batch を使用します |
オーケストレーションのアーキテクチャ
Orchestration = Stages → Steps → Background Automations
Stage 1: "HR Review"
├─ Step 1.1: Interactive Step (HR Manager reviews)
├─ Step 1.2: Background Automation (create records)
└─ Decision: Approved? → Next Stage : End
Stage 2: "IT Provisioning"
├─ Step 2.1: Interactive Step (IT assigns equipment)
├─ Step 2.2: Background Automation (provision accounts)
└─ Step 2.3: Interactive Step (IT confirms completion)
Stage 3: "Manager Onboarding"
├─ Step 3.1: Interactive Step (Manager schedules 1:1)
└─ Step 3.2: Background Automation (send welcome email)
オーケストレーションの構築(ステップごと)
例:従業員のオンボーディングプロセス
要件:
- 人事が新入社員の書類を確認 → 承認/却下
- 承認された場合、IT がアカウントと機器を準備
- マネージャーが初日を設定し、メンターを割り当て
- 各段階でシステムが通知を送信
ステップ 1:オーケストレーションを作成
Setup → Flows → New Flow → Orchestration
Name: Employee_Onboarding
Object: Employee__c (custom object)
Trigger: Record Created, Status = 'Pending Onboarding'
ステップ 2:段階を設計
段階 1:人事による書類確認
Stage Name: HR_Document_Review
Stage Description: HR verifies employee documentation
Run Mode: One at a Time (sequential)
Step 1.1 (Interactive):
- Name: Review_Documents
- Assigned To: Queue "HR_Onboarding_Queue"
- Due Date: 2 days from start
- Screen Flow: HR_Document_Review_Screen
- Inputs: Employee__c.Id
Step 1.2 (Background - Decision):
- If HR_Approved = true → Next Stage
- If HR_Approved = false → End + Send Rejection Email
段階 2:IT による準備
Stage Name: IT_Provisioning
Condition: Runs only if Stage 1 approved
Step 2.1 (Interactive):
- Name: Assign_Equipment
- Assigned To: Queue "IT_Provisioning_Queue"
- Due Date: 3 days from stage start
- Screen Flow: IT_Equipment_Assignment
- Inputs: Employee__c.Id
Step 2.2 (Background):
- Name: Create_AD_Account
- Autolaunched Flow: Create_Active_Directory_Account
- Inputs: Employee__c.Email, Employee__c.FirstName
Step 2.3 (Background):
- Name: Send_IT_Confirmation
- Action: Send Email Template
- Recipient: Employee__c.Email
- Template: Welcome_Email
段階 3:マネージャーによる設定
Stage Name: Manager_Setup
Depends On: Stage 2 complete
Step 3.1 (Interactive):
- Name: Schedule_First_Day
- Assigned To: Employee__c.Manager__c
- Due Date: 1 day from stage start
- Screen Flow: Manager_Onboarding_Tasks
Step 3.2 (Background):
- Name: Update_Status
- Record Update: Employee__c.Status = 'Onboarding Complete'
ステップ 3:障害パスを実装(Summer '25)
IT の準備に失敗した場合の障害パス:
If Step 2.2 (Create_AD_Account) fails:
├─ Retry Step (1 attempt after 10 minutes)
├─ If still fails:
│ ├─ Send email to IT Manager with error details
│ ├─ Create Task for manual provisioning
│ └─ Assign Interactive Step to IT Manager for resolution
└─ Continue to Stage 3 (don't block entire process)
設定:
Step 2.2: Create_AD_Account
├─ Fault Path Enabled: true
├─ Retry Attempts: 1
├─ Retry Delay: 10 minutes
└─ On Final Failure:
├─ Create Task
│ ├─ Subject: "Manual AD Account Creation Needed"
│ ├─ Assigned To: IT_Manager_Queue
│ └─ Priority: High
└─ Send Email Notification
├─ Template: IT_Provisioning_Failure
└─ Recipients: IT Managers
対話型ステップとバックグラウンドステップ
対話型ステップ
使用する場面:人間の判断や入力が必要なアクション
Interactive Step Configuration:
├─ Screen Flow: Define UI for user input
├─ Assigned To: User, Queue, or Role
├─ Due Date: Formula (TODAY() + 2 for 2 days)
├─ Instructions: What user should do
├─ Input Variables: Data passed to screen flow
└─ Output Variables: Data returned from user
画面フローの例(人事による確認):
Screen: Review Documents
├─ Display: Employee Name, Position, Documents Uploaded
├─ Input: Radio Button (Approve / Reject)
├─ Input: Text Area (Comments - required if reject)
└─ Action: Save & Submit
Output Variables:
- HR_Approved (Boolean)
- HR_Comments (Text)
バックグラウンドステップ
使用する場面:ユーザーとのやり取りを伴わない自動アクション
Background Step Types:
├─ Autolaunched Flow: Call another flow
├─ Apex Action: Invoke Apex method
├─ Send Email: Email template or custom
├─ Post to Chatter: Notify users
├─ Create Records: DML operations
├─ Update Records: Field updates
├─ External Service: REST callout
└─ Wait: Pause for duration or until condition
高度なパターンと監視
高度な Flow Orchestrator の設計(並列承認、条件分岐、再試行/エスカレーション、レコードトリガーによるオーケストレーション、外部連携への引き継ぎ)に加え、監視、レポート、運用ダッシュボードについては、references/advanced-patterns-monitoring.md を参照してください。複雑な多段階の実装や本番環境の可観測性が必要な場合は、このリファレンスを読み込んでください。
他の機能との連携
パターン:オーケストレーション + 承認プロセス
Stage 2: Manager Approval
├─ Step 2.1 (Interactive): Manager reviews
│ └─ Screen Flow with Approve/Reject buttons
├─ Background Automation: Update approval status
└─ If Approved: Proceed to Stage 3
If Rejected: Send rejection email, End orchestration
パターン:オーケストレーション + プラットフォームイベント
段階の切り替え時にイベントを公開します:
trigger OrchestrationStageTrigger on FlowOrchestrationStageInstance (after insert, after update) {
List<OrchestrationStageEvent__e> events = new List<OrchestrationStageEvent__e>();
for (FlowOrchestrationStageInstance stage : Trigger.new) {
if (stage.Status == 'Completed') {
events.add(new OrchestrationStageEvent__e(
OrchestrationId__c = stage.OrchestrationInstanceId,
StageName__c = stage.StepDefinitionName,
CompletedDate__c = System.now()
));
}
}
if (!events.isEmpty()) {
EventBus.publish(events);
}
}
外部で購読します:
// External system tracks orchestration progress
client.subscribe('/event/OrchestrationStageEvent__e', (message) => {
const { OrchestrationId__c, StageName__c } = message.data.payload;
console.log(`Stage ${StageName__c} completed for ${OrchestrationId__c}`);
// Update external dashboard
updateOrchestrationStatus(OrchestrationId__c, StageName__c);
});
パターン:オーケストレーション + Agentforce
AI エージェントが特定のステップを処理します:
Stage 2: Document Verification
├─ Step 2.1 (Background): AI agent verifies documents
│ └─ Agentforce Action: Verify_Document_Compliance
│ - Uses Einstein OCR to extract text
│ - Uses LLM to validate against compliance rules
│ - Returns: Compliant (true/false) + Confidence score
├─ Decision: If confidence < 90% → Human review
└─ Step 2.2 (Interactive - Conditional): Human verifies (if AI uncertain)
ベストプラクティス
設計
- 構築前にステージを計画する:ワークフローを紙やホワイトボードにスケッチします
- オーケストレーションごとに1つのビジネスプロセスにする:無関係なプロセスを組み合わせないでください
- 意味のあるステージ名/ステップ名を付ける:技術用語ではなく、ビジネス用語を使います
- 明確な指示を示す:各ステップでユーザーが何をすべきかを正確に伝えます
- 適切な期限を設定する:緊急性と現実的なスケジュールのバランスを取ります
パフォーマンス
- ステージごとのステップを最小限にする:保守性を高めるため、ステージごとに10ステップ未満にします
- 不要な待機を避ける:本当に必要な場合にのみ一時停止します
- バックグラウンド自動化を一括処理する:複数のレコードを効率的に処理します
- 判断ロジックを適切に使う:条件を使って不要なステージをスキップします
- アクティブなオーケストレーションを監視する:完了したものは定期的にアーカイブします
エラー処理
- 必ず障害パスを実装する(Summer '25):失敗によってプロセス全体が止まらないようにします
- 一時的なエラーを再試行する:ネットワークの問題や一時的な API エラーに対応します
- 恒久的なエラーをエスカレーションする:手動での対応が必要なタスクを作成します
- 失敗を記録する:トラブルシューティングのため、何が問題だったかを追跡します
- エラーシナリオをテストする:Sandbox で意図的に失敗を発生させます
セキュリティ
- 共有ルールを遵守する:オーケストレーションから呼び出される Apex では「with sharing」を使用します
- 項目レベルのセキュリティ:画面フローで、ユーザーが項目にアクセスできることを確認します
- キューのメンバーシップ:キュー内のユーザーが必要な権限を持っていることを確認します
- 機密データ:画面フローや作業項目では、PII をマスキングまたは暗号化します
ユーザーエクスペリエンス
- モバイルに対応した画面:多くのユーザーがモバイルデバイスで作業します
- 進行状況インジケーター:プロセスのどこにいるかをユーザーに示します
- 次のステップを明確にする:ステップの完了後に何が起こるかを常にユーザーに伝えます
- 適切なタイミングで通知する:期限前にリマインダーを送信します
- 送信時にフィードバックを示す:操作が正常に完了したことを確認します
トラブルシューティング
よくある問題
問題 1:作業項目がユーザーに表示されない
Causes:
- User not in assigned queue
- User lacks permission to object
- Filter criteria on view excludes item
Solution:
1. Check queue membership: Setup → Queues
2. Verify object permissions: User profile/permission set
3. Review work item list view filters
問題 2:バックグラウンドステップが何も表示せずに失敗する
Causes:
- Apex error in called flow/action
- Required field missing
- Governor limit exceeded
Solution:
1. Enable debug logs: Setup → Debug Logs
2. Check Flow error emails: Setup → Process Automation Settings
3. Implement fault path to catch and handle errors
問題 3:オーケストレーションがトリガーされない
Causes:
- Trigger criteria not met
- Record not updated properly
- Orchestration inactive
Solution:
1. Verify record meets entry criteria
2. Check orchestration activation status
3. Review audit trail for record updates
Apex でデバッグする
// Query orchestration details for debugging
public class OrchestrationDebugger {
public static void debugOrchestration(Id recordId) {
// Find orchestration instances for record
List<FlowOrchestrationInstance> instances = [
SELECT Id, Label, Status, CreatedDate
FROM FlowOrchestrationInstance
WHERE RelatedRecordId = :recordId
ORDER BY CreatedDate DESC
];
for (FlowOrchestrationInstance instance : instances) {
System.debug('Orchestration: ' + instance.Label);
System.debug('Status: ' + instance.Status);
// Get work items
List<FlowOrchestrationWorkItem> items = [
SELECT Id, Label, Status, AssignedToId, DueDate
FROM FlowOrchestrationWorkItem
WHERE OrchestrationInstanceId = :instance.Id
ORDER BY CreatedDate
];
for (FlowOrchestrationWorkItem item : items) {
System.debug(' Step: ' + item.Label + ', Status: ' + item.Status);
}
}
}
}
価格と提供状況
- エディション:Enterprise、Performance、Unlimited、Developer
- 含まれる実行回数:年間600回のオーケストレーション実行(無料)
- 追加の実行回数:大量に利用する場合は、まとまった単位で購入できます
- 必要な権限:
- 作成/編集:Manage Flows 権限
- 表示:View Orchestration in Automation App(Winter '26)
- フローの承認:Approval Designer システム権限(Winter '26)
リソース
- Flow Orchestrator ガイド:https://help.salesforce.com/s/articleView?id=platform.orchestrator_flow_orchestrator.htm
- Trailhead:「Flow Orchestration Basics」
- リリースノート:最新機能については Summer '25 と Winter '26 を参照してください
- FlowOrchestrationWorkItem リファレンス:Salesforce オブジェクトリファレンスのドキュメント
Process Builder からの移行
Process Builder → Flow Orchestrator:
Process Builder supports only simple automation
Flow Orchestrator adds:
- Multi-user coordination
- Interactive steps
- Stage-based organization
- Visual progress tracking
- Fault handling
When to migrate:
- Process involves multiple users
- Need stage-based workflow
- Want user interface for steps
- Require better error handling
Flow Orchestrator は、複雑で複数の部門にまたがるビジネスプロセスを、組織全体で拡張できる、視覚的に管理しやすいワークフローへと変換します。