Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Workflow engine with go #2
Search
Tsuji Daishiro
February 07, 2020
Technology
0
1.3k
Workflow engine with go #2
Tsuji Daishiro
February 07, 2020
Tweet
Share
More Decks by Tsuji Daishiro
See All by Tsuji Daishiro
Starting static analysis with Go
tutuz
0
2.1k
実務で役立つTCPクライアントの作り方
tutuz
6
5.3k
What's new Context in Go1.14
tutuz
2
1.6k
Workflow engine with go
tutuz
0
1.9k
Nginx cache pitfalls
tutuz
0
250
Check inline expansion with Go
tutuz
0
3k
Parallel-Simulated-Annealing
tutuz
3
5k
Other Decks in Technology
See All in Technology
AgentCore BrowserとClaude Codeスキルを活用した 『初手AI』を実現する業務自動化AIエージェント基盤
ruzia
7
2.1k
AWSインフルエンサーへの道 / load of AWS Influencer
whisaiyo
0
240
202512_AIoT.pdf
iotcomjpadmin
0
160
フィッシュボウルのやり方 / How to do a fishbowl
pauli
2
430
「駆動」って言葉、なんかカッコイイ_Mitz
comucal
PRO
0
130
AWS re:Inventre:cap ~AmazonNova 2 Omniのワークショップを体験してきた~
nrinetcom
PRO
0
120
日本の AI 開発と世界の潮流 / GenAI Development in Japan
hariby
2
710
Authlete で実装する MCP OAuth 認可サーバー #CIMD の実装を添えて
watahani
0
300
株式会社ビザスク_AI__Engineering_Summit_Tokyo_2025_登壇資料.pdf
eikohashiba
1
140
AWSに革命を起こすかもしれない新サービス・アップデートについてのお話
yama3133
0
530
Next.js 16の新機能 Cache Components について
sutetotanuki
0
210
Oracle Cloud Infrastructure:2025年12月度サービス・アップデート
oracle4engineer
PRO
0
100
Featured
See All Featured
Building Applications with DynamoDB
mza
96
6.9k
Faster Mobile Websites
deanohume
310
31k
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
0
35
The innovator’s Mindset - Leading Through an Era of Exponential Change - McGill University 2025
jdejongh
PRO
1
74
Making the Leap to Tech Lead
cromwellryan
135
9.7k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
2.7k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
10
770
Bash Introduction
62gerente
615
210k
How STYLIGHT went responsive
nonsquared
100
6k
Ecommerce SEO: The Keys for Success Now & Beyond - #SERPConf2024
aleyda
1
1.7k
30 Presentation Tips
portentint
PRO
1
180
Transcript
Goでワークフローエンジンを作る 2020/2/7(Fri) golang.tokyo #29 Future Architect Tsuji Daishiro
Who are you? 辻 大志郎(つじ だいしろう) @d_tutuz 渋谷区役所(~2014/9) Future Architect(2014/10~)
✓ 所属 Technology Innovation Group 競技プログラミング部 2
None
Goの標準コードリーディング会やってます ✓ 社内で標準コードリーディング会やってます ✓ 全12回で、3回まで開催済 ✓ 以下のパッケージ ✓ io ✓
errors ✓ hash/maphash ✓ context ✓ flag ✓ path ✓ testing ✓ iotest ✓ sort ✓ net/http 1 (client) ✓ net/http 2 (server) ✓ database/sql 4
ワークフローエンジンとは? ✓ 以下のようなことを実施するソフトウェア • 定期的なタスクの実行 • タスク間の依存関係を定義でき、順序関係を制御してタスクを実行 • タスクの実行状況/結果を管理 ✓
定型業務の自動化 5
タスクとフロー ✓ タスク:処理の単位 ✓ フロー:タスクの集合 6 タスク フロー タスク タスク
既存のワークフローエンジン 7 ✓ OSSにいろんなワークフローエンジンはある ✓ Apache Airflow ✓ Argo ✓
Rundeck … ✓ 高機能かつ自由度が高いので便利 ✓ 業務のニーズに合わないことも… ✓ タスクをGoで実装できなかったり…
None
Flowerを作った 9 ✓ フロー(Flow)を扱うソフトウェア(er)ということでFlower ✓ 以下を目指して作った ✓ タスクの管理が容易 ✓ タスクをGoで実装可能
✓ https://github.com/d-tsuji/flower
アーキテクチャ 10 ✓ Register(タスクの実行登録) ✓ Watcher(タスクの実行監視/制御) ✓ Worker(タスクの実行)
Flowerの特徴 11 ✓ タスク管理 ✓ タスクの順序をマスタで一括管理 ✓ パラメータなどの埋め込みが可能 ✓ タスクを構成する処理はComponentとしてGoで実装
✓ Exactly Once ✓ リカバリ/リラン ✓ エラー時にどのタスクでエラーになったかわかる仕組みを提供 ✓ テーブルのレコード更新でリランが可能 ✓ 並列実行 ✓ 流量制御
タスクの定義方法 12 ✓ タスクはGoのソースで、実行順序はマスタで管理できるようにしたかった ✓ ただRDSの常時起動はお高く、エコではないので、要検討。組み込みのデータベースを使うなどはある
タスク実行管理/制御 13 ✓ タスクは管理テーブルで永続化 ✓ タスクのロスト、重複実行の制御は最重要な要素の一つ ✓ RDBMSが一番扱いやすい タスク管理テーブル exec_status
0:実行待ち 1:実行中 3:完了
落ち葉拾い 14 ✓ タスク監視のポーリング ✓ キュー(SQSとか)をはさめばイベント通知にできる ✓ イベント or ポーリングをモードとして選択できると良さそう
✓ 内蔵スケジューラ ✓ 管理コンソール ✓ ほしいけどかつ必要だけど、未作成 ✓ GUIによるワークフロー開発 ✓ 任意のDAGのサポート
楽しいワークフローエンジンライフを!