my set up is as follow I have hosted agent that as first job copies files from the self-hosted agent which is started as a docker container
the hosted pipeline is triggered with pipeline "run" rest API :
https://docs.microsoft.com/en-us/rest/api/azure/devops/pipelines/runs/run%20pipeline?view=azure-devops-rest-6.0
this is how the body looks like now :
"resources": {
        "repositories:": {
            "self": {
                "refName": "refs/heads/my_branch"
            }
        }
    }
it is working great.
now the part of the hosted pipeline looks like this :
- job: self_hosted_connect
  timeoutInMinutes: 10
  pool: Default
  steps:
  - task: CopyFiles@2
    inputs:
      SourceFolder: '/home/copy_dir'
      Contents: '**'
      TargetFolder: '$(build.artifactstagingdirectory)'
also, work great.
My questions are :
- I like to send in the "run" rest API another parameter that contains the SourceFolder path so that the CopyFiles task will be dynamic and not have hardcode SourceFolder path 
- When i run the self-hosted agent from docker how do i tell the self-hosted agent to include the directory outside its working dir? so the pipeline will not fail with the error : - #[error]Unhandled: Not found SourceFolder: /home/copy_dir 
UPDATE i updated the request to :
{
    "resources": {
        "repositories:": {
            "self": {
                "refName": "refs/heads/my_branch"
            }
        }
    },
    "templateParameters": {
        "Folderpath":"{/home/foo/my_dir}"
    }
}
but I'm getting an error:
{
    "$id": "1",
    "innerException": null,
    "message": "Unexpected parameter 'Folderpath'",
    "typeName": "Microsoft.Azure.Pipelines.WebApi.PipelineValidationException, Microsoft.Azure.Pipelines.WebApi",
    "typeKey": "PipelineValidationException",
    "errorCode": 0,
    "eventId": 3000
}
