Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Workflow configuration #2

Open
joshhornby opened this issue Nov 21, 2018 · 0 comments
Open

Improve Workflow configuration #2

joshhornby opened this issue Nov 21, 2018 · 0 comments
Labels
help wanted Extra attention is needed

Comments

@joshhornby
Copy link
Owner

joshhornby commented Nov 21, 2018

Currently when adding a workflow the configuration must be json, we should improve this.

resource "twiliotaskrouter_workflow" "english_agents_workflow" {
    friendly_name = "Example Workflow"
    task_reservation_timeout = "20"
    configuration = <<EOF
{
"task_routing": {
        "default_filter": {
            "queue": "${twiliotaskrouter_queue.english_language_queue.id}"
        },
        "filters": [
            {
                "filter_friendly_name": "Hello World",
                "expression": "type=='sales'",
                "targets": [
                    {
                        "queue": "${twiliotaskrouter_queue.english_language_queue.id}",
                        "priority": "100"
                    },
                    {
                        "queue": "${twiliotaskrouter_queue.english_language_queue.id}",
                        "priority": "10"
                    }
                ]
            }
        ]
    }
}
EOF

  depends_on = ["twiliotaskrouter_queue.english_language_queue", "twiliotaskrouter_queue.english_language_queue"]
}

Something like this is my initial idea, but hoping others will have some ideas.

resource "twiliotaskrouter_workflow_configuration" "workflow_configuration" {
    default_queue: "${twiliotaskrouter_queue.english_language_queue.id}"
    filter {
        friendly_name: "Hello World"
        expression: "type=='sales'"
        targets: [
            {
              queue: "${twiliotaskrouter_queue.english_language_queue.id}"
              priority: "100"
            }
        ]
    }
}

resource "twiliotaskrouter_workflow" "english_agents_workflow" {
    friendly_name = "Example Workflow"
    task_reservation_timeout = "20"
    configuration = "${twiliotaskrouter_workflow_configuration.workflow_configuration.json}"
}
@joshhornby joshhornby added the help wanted Extra attention is needed label Nov 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant