<%args> $q => undef % if ($workflow) { <& '/service/workflow/show_instance.html', 'msg' => $msg, &> % } % else { <& '/service/workflow/search_instances.html', 'context_key' => [ '%', '' ], 'context_value' => [ '%' . $q . '%', '' ], &> % } <%init> use Data::Dumper; my $workflow; my $msg = $context->{client}->send_receive_command_msg( 'get_workflow_info', { ID => $q, }, ); if (exists $msg->{PARAMS}->{WORKFLOW}->{ID} && $msg->{PARAMS}->{WORKFLOW}->{ID} == $q) { # the search input was a workflow ID $workflow = 1; }