How do I use variables in links.task.yml? I have a local links.task.yml file to display the tab for the node data , But it seems to have a problem passing argument to the path . As you can see i am extending the node's basic fetaures like edit,delete.revision with an additional function using tab .  I have module_name.links.task.yml

entity.node.check_backend:
  route_name: module_name.my_route
  base_route: entity.node.canonical
  title: My title


And i have the route in module_name.routing.yml  as follows 

module_name.my_route:
  path: '/node/{arg1}/function_name'
  defaults:
    _controller: '\Drupal\module_name\Controller\ControllerName::function_name'
    _title: 'My title'
  requirements:
    _permission: 'access admin tab'


But it throws me error like :


  Symfony\Component\Routing\Exception\MissingMandatoryParametersException:
  Some mandatory parameters are missing ("arg1") to generate a URL for
  route "module_name.my_route".


How can i pass variables in links.task.yml file ?
In your module_name.links.task.yml file you can add a route_parameters: array that lists the parameters you want to pass, in your case it would end up:

entity.node.check_backend:
  route_name: module_name.my_route
  base_route: entity.node.canonical
  title: My title
  route_parameters:
    arg1:  'value_for_arg1'


You can find this by looking at the code in \Drupal\Core\Menu\LocalTaskManager which parses this file.