package
0.0.0-20240102190251-992cee951de1
Repository: https://github.com/indeedeng/iwf-golang-samples.git
Documentation: pkg.go.dev

# README

Use case

Screenshot 2023-04-21 at 8 54 44 AM
  • An engagement is initiated by an employer to reach out to a jobSeeker(via email/SMS/etc)
  • The jobSeeker could respond with decline or accept
  • If jobSeeker doesn't respond, it will get reminder
  • An engagement can change from declined to accepted, but cannot change from accepted to declined

API requirements

  • Start an engagement
  • Describe an engagement
  • Opt-out email reminder for an engagement
  • Decline engagement
  • Accept engagement
  • Notify external systems about the engagement changes, with eventual consistency guarantee
  • List engagements in different/any patterns (which would require a lot of indexes if using traditional DB)
    • By employerId, status order by updateTime
    • By jobSeekerId, status order by updateTime
    • By employerId + jobSeekerId
    • By status, order by updateTime

Design

Screenshot 2023-04-21 at 8 58 50 AM

Implementation Details

InitState

Screenshot 2023-05-23 at 4 19 07 PM

ReminderState

Screenshot 2023-05-23 at 4 19 18 PM

RPC

Screenshot 2023-05-23 at 4 19 28 PM

NotifyExtState

Screenshot 2023-05-23 at 4 19 46 PM

Controller

And controller is a very thin layer of calling iWF client APIs and workflow RPC stub APIs. See engagement_controller.

How to run

First of all, you need to register the required Search attributes

Search attribute requirement

If using Temporal:

  • New CLI
tctl search-attribute create -name EmployerId -type Keyword -y
tctl search-attribute create -name JobSeekerId -type Keyword -y
tctl search-attribute create -name EngagementStatus -type Keyword -y
tctl search-attribute create -name LastUpdateTimeMillis -type Int -y
  • Old CLI
tctl adm cl asa -n EmployerId -t Keyword
tctl adm cl asa -n JobSeekerId -t Keyword
tctl adm cl asa -n Status -t Keyword
tctl adm cl asa -n LastUpdateTimeMillis -t Int

If using Cadence

cadence adm cl asa --search_attr_key EmployerId --search_attr_type 1
cadence adm cl asa --search_attr_key JobSeekerId --search_attr_type 1
cadence adm cl asa --search_attr_key Status --search_attr_type 1
cadence adm cl asa --search_attr_key LastUpdateTimeMillis --search_attr_type 2

How to test the APIs in browser

# Functions

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Constants

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Structs

No description provided by the author
No description provided by the author
No description provided by the author

# Type aliases

No description provided by the author