version: '2.0'

purr.process_stg1_tweet:
    description: Process tweet for stage 1 of the puzzle.
    input:
        - contestant
        - tweet_text
        - tweet_timestamp
    vars:
        tracker: <% $.contestant + '.stage.1' %>
        answer_key: 'system.kitty.answer.1'

    tasks:
        get_answer:
            action: st2.kv.get
            input:
                key: <% $.answer_key %>
            publish:
                answer: <% task(get_answer).result.result %>
            on-success:
                - validate_tweet
        validate_tweet:
            action: purr.validate_tweet
            input:
                contestant: <% $.contestant %>
                tweet_text: <% $.tweet_text %>
                answer: <% $.answer %>
            on-error:
                - noop
            on-success:
                - follow_contestant
        follow_contestant:
            action: twitter.follow
            input:
                screen_name: <% $.contestant %>
            on-success:
                - notify_contestant
        notify_contestant:
            action: twitter.direct_message
            input:
                screen_name: <% $.contestant %>
                message: "https://gist.github.com/StorminStanley/4eb0b56fe1d35aa51fb80f5a70abf86f"
            on-success:
                - set_tracker
        set_tracker:
            action: st2.kv.set
            input:
                key: <% $.tracker %>
                value: <% $.tweet_timestamp %>

version: '2.0'

purr.process_stg1_tweet:
    description: Process tweet for stage 1 of the puzzle.
    input:
        - contestant
        - tweet_text
        - tweet_timestamp
    vars:
        tracker: <% $.contestant + '.stage.1' %>
        answer_key: 'kitty.answer.1'

    tasks:
        get_answer:
            action: st2.kv.get
            input:
                key: <% $.answer_key %>
            publish:
                answer: <% task(get_answer).result.result %>
            on-success:
                - validate_tweet
        validate_tweet:
            action: purr.validate_tweet
            input:
                contestant: <% $.contestant %>
                tweet_text: <% $.tweet_text %>
                answer: <% $.answer %>
            on-error:
                - noop
            on-success:
                - follow_contestant
        follow_contestant:
            action: twitter.follow
            input:
                screen_name: <% $.contestant %>
            on-success:
                - notify_contestant
        notify_contestant:
            action: twitter.direct_message
            input:
                screen_name: <% $.contestant %>
                message: "https://gist.github.com/StorminStanley/4eb0b56fe1d35aa51fb80f5a70abf86f"
            on-success:
                - set_tracker
        set_tracker:
            action: st2.kv.set
            input:
                key: <% $.tracker %>
                value: <% $.tweet_timestamp %>

Fix key name for answer 1
Fix key name for answer 1
