![]() |
|
![]() |
|
![]() |
|
![]() |
|
![]() |
|
![]() |
|
![]() |
|
![]() |
|
![]() |
|
![]() |
|
![]() |
|
![]() |
|
![]() |
|
![]() |
|
![]() |
|
클라우드 리소스를 프로비저닝하거나 기계 학습 모델을 생산에 홍보하거나 고객의 신용 카드를 청구하기 전에 승인이 필요할 수 있습니다.
Have you ever wanted to pause an automated workflow to wait for a human decision? Maybe you need approval before provisioning cloud resources, promoting a machine learning model to production, or charging a customer’s credit card.
인간의 결정을 기다리기 위해 자동화 된 워크 플로우를 일시 중지하고 싶었던 적이 있습니까? 클라우드 리소스를 프로비저닝하거나 기계 학습 모델을 생산에 홍보하거나 고객의 신용 카드를 청구하기 전에 승인이 필요할 수 있습니다.
In many data science and machine learning workflows, automation gets you 90% of the way — but that critical last step often needs human judgment. Especially in production environments, model retraining, anomaly overrides, or large data movements require careful human review to avoid expensive mistakes.
많은 데이터 과학 및 기계 학습 워크 플로에서 자동화는 90%를 얻을 수 있지만 그 중요한 마지막 단계는 종종 인간의 판단이 필요합니다. 특히 생산 환경에서 모델 재교육, 이상 무시 또는 대규모 데이터 움직임에는 비싼 실수를 피하기 위해 신중한 인간 검토가 필요합니다.
In my case, I needed to manually review situations where my system flagged more than 6% of customer data for anomalies — often due to accidental pushes by customers. Before I implemented a proper workflow, this was handled informally: developers would directly update production databases (!) — risky, error-prone, and unscalable.
제 경우에는 시스템이 변칙에 대한 고객 데이터의 6% 이상을 표시 한 상황을 수동으로 검토해야했습니다. 적절한 워크 플로를 구현하기 전에 이것은 비공식적으로 처리되었습니다. 개발자는 프로덕션 데이터베이스 (!) (위험하고 오류가 발생하기 쉬우 며 고집 할 수없는 업데이트됩니다.
To solve this, I built a scalable manual approval system using AWS Step Functions, Slack, Lambda, and SNS — a cloud-native, low-cost architecture that cleanly paused workflows for human approvals without spinning up idle compute.
이를 해결하기 위해 AWS Step Functions, Slack, Lambda 및 SNS를 사용하여 확장 가능한 수동 승인 시스템을 구축했습니다. 클라우드 네이티브의 저렴한 아키텍처는 유휴 컴퓨팅을 회전시키지 않고 인간의 승인을 위해 워크 플로우를 깨끗하게 일시 정지했습니다.
In this post, I’ll walk you through the full design, the AWS resources involved, and how you can apply it to your critical workflows.
이 게시물에서는 전체 디자인, 관련된 AWS 리소스 및 중요한 워크 플로에 적용하는 방법을 안내합니다.
Let’s get into it 👇
그것에 들어가자 it
The Solution
해결책
My application is deployed in the AWS ecosystem, so we’ll use Aws Step Functions to build a state machine that:
내 응용 프로그램은 AWS 생태계에 배포되므로 AWS 단계 기능을 사용하여 다음과 같은 상태 머신을 구축합니다.
Here is a youtube video showing the demo and actual application in action:
다음은 데모 및 실제 응용 프로그램을 보여주는 YouTube 비디오입니다.
I have also hosted the live demo app here →👉 https://v0-manual-review-app-fwtjca.vercel.app
나는 또한 라이브 데모 앱을 여기에서 호스팅했습니다 → https://v0-manual-review-app-fwtjca.vercel.app
All code is hosted here with the right set of IAM permissions.
모든 코드는 여기에서 올바른 IAM 권한 세트로 호스팅됩니다.
Step-by-Step Implementation
단계별 구현
The flow above generates a dataset, uploads it to AWS S3 and if a review is required, then invokes the Manual Review lambda. On the manual review step, we’ll use a Task lambda with an invoke on WaitForTaskToken, which pauses execution until resumed. The lambda reads the token this way:
위의 흐름은 데이터 세트를 생성하고 AWS S3에 업로드하고 검토가 필요한 경우 수동 검토 Lambda를 호출합니다. 수동 검토 단계에서, 우리는 WaitfortaskToken에서 호출 된 작업 Lambda를 사용하여 재개 될 때까지 실행을 일시 중지합니다. 람다는이 방법으로 토큰을 읽습니다.
This Lambda sends a Slack message that includes the task token so the function knows what execution to resume.
이 Lambda는 작업 토큰이 포함 된 슬랙 메시지를 보냅니다.이 기능은 재개 할 실행을 알 수 있습니다.
2. Before the we send out the slack notification, we need to
2. Slack 알림을 보내기 전에
I followed the youtube video here for my setup.
설정을 위해 YouTube 비디오를 따라갔습니다.
3. Once the above is setup, setup the variables into the web-hook step of the slack workflow:
3. 위의 설정이 설정되면 변수를 느슨한 워크 플로의 웹 후크 단계로 설정하십시오.
And use the variables with a helpful note in the following step:
다음 단계에서 유용한 메모와 함께 변수를 사용하십시오.
The final workflow will look like this:
최종 워크 플로는 다음과 같습니다.
4. Send a Slack Notification published to an SNS topic (you can alternately use slack-sdk as well) with job parameters. Here is what the message will look like:
4. 작업 매개 변수와 함께 SNS 주제에 게시 된 슬랙 알림 (Slack-SDK를 교대로 사용할 수 있음)을 보내십시오. 다음은 메시지의 모습입니다.
This Lambda sends a Slack message that includes the task token so the function knows what execution to resume.
이 Lambda는 작업 토큰이 포함 된 슬랙 메시지를 보냅니다.이 기능은 재개 할 실행을 알 수 있습니다.
5. Once a review notification is received in slack, the user can approve or reject it. The step function goes into a wait state until it receives a user response; however the task part is set to expire in 24 hours, so inactivity will timeout the step function.
5. 검토 알림이 슬랙에서 수신되면 사용자는이를 승인하거나 거부 할 수 있습니다. 단계 함수는 사용자 응답을받을 때까지 대기 상태로 들어갑니다. 그러나 작업 부분은 24 시간 안에 만료되도록 설정되므로 비 활동이 단계 함수를 시간 초과합니다.
Based on whether the user approves or rejects the review request, the rawPath gets set and can be parsed here: code
사용자가 검토 요청을 승인하거나 거부하는지 여부에 따라 RawPath가 설정되어 여기에서 구문 분석 할 수 있습니다.
The receiving API Gateway + Lambda combo:
수신 API 게이트웨이 + 람다 콤보 :
Example:
예:
Note: Lambda configured with WaitForTaskToken must wait. If you don’t send the token, your workflow just stalls.
참고 : WaitfortaskToken으로 구성된 Lambda는 기다려야합니다. 토큰을 보내지 않으면 워크 플로가 마구간 만 마무리합니다.
Bonus: If you need email or SMS alerts, use SNS to notify a broader group.Just sns.publish() from within your Lambda or Step Function.
보너스 : 이메일 또는 SMS 알림이 필요한 경우 SNS를 사용하여 Lambda 또는 Step 함수 내에서 더 넓은 Group.just Sns.publish ()에 알립니다.
Testing
테스트
Once the manual approval system was wired up, it was time to kick the tires. Here’s how I tested it:
수동 승인 시스템이 연결되면 타이어를 걷어차는 시간이었습니다. 테스트 방법은 다음과 같습니다.
I tested all major paths:
나는 모든 주요 경로를 테스트했습니다.
Behind the scenes, I also verified that :
무대 뒤에서 나는 또한 다음을 확인했다.
I highly recommend testing not just happy paths, but also “what if nobody clicks?” and “what if Slack glitches?” — catching these edge cases early saved me headaches later.
나는 행복한 길뿐만 아니라 "클릭하지 않으면 어떻게 될까요?" 그리고 "느슨한 결함이 있다면 어떨까요?" -이 가장자리 케이스를 일찍 잡으면 나중에 두통을 저장했습니다.
Lessons Learned
배운 교훈
Wrapping Up
마무리
Adding human-in-the-loop logic doesn’t have to mean duct tape and cron jobs. With Step Functions + Slack, you can build reviewable, traceable, and production-safe approval flows.
인간의 루프 논리를 추가한다고해서 덕트 테이프와 Cron 작업을 의미 할 필요는 없습니다. Step Functions + Slack을 사용하면 검토 가능, 추적 가능 및 생산 안전 승인 흐름을 구축 할 수 있습니다.
If this helped, or you’re trying something similar, drop a note in the comments! Let’s build better workflows.
이것이 도움이되었거나 비슷한 것을 시도하면 주석에 메모를 떨어 뜨립니다! 더 나은 워크 플로를 구축합시다.
Note: All images in this article were created by the author
참고 :이 기사의 모든 이미지는 저자가 작성했습니다.
부인 성명:info@kdj.com
제공된 정보는 거래 조언이 아닙니다. kdj.com은 이 기사에 제공된 정보를 기반으로 이루어진 투자에 대해 어떠한 책임도 지지 않습니다. 암호화폐는 변동성이 매우 높으므로 철저한 조사 후 신중하게 투자하는 것이 좋습니다!
본 웹사이트에 사용된 내용이 귀하의 저작권을 침해한다고 판단되는 경우, 즉시 당사(info@kdj.com)로 연락주시면 즉시 삭제하도록 하겠습니다.
-
-
-
-
-
-
-
-
- Popcat
- 2025-05-13 12:15:13
- 분석가 Altcoin Sherpa에 따르면, 강력한 황소 시장에서 교과서 50% 회복을 기다리는 상인들은 보트가 누락 될 수 있습니다.
-