#
# This workflow demonstrates an agent that requires tool approval
# in a loop responding to user input.
#
# Example input: 
# What is Microsoft Graph API used for?
#
kind: Workflow
trigger:

  kind: OnConversationStart
  id: workflow_demo
  actions:

    - kind: InvokeAzureAgent
      id: invoke_search
      conversationId: =System.ConversationId
      agent:
        name: DocumentSearchAgent

    - kind: RequestExternalInput
      id: request_requirements

    - kind: ConditionGroup
      id: check_completion
      conditions:

        - condition: =Upper(System.LastMessage.Text) = "EXIT"
          id: check_done
          actions:

            - kind: EndWorkflow
              id: all_done

      elseActions:
        - kind: GotoAction
          id: goto_search
          actionId: invoke_search
