Yandex Cloud
Search
Contact UsGet started
  • Blog
  • Pricing
  • Documentation
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • ML & AI
    • Business tools
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Customer Stories
    • Gateway to Russia
    • Cloud for Startups
    • Education and Science
  • Blog
  • Pricing
  • Documentation
Yandex project
© 2025 Yandex.Cloud LLC
Yandex Cloud Functions
  • Comparison with other Yandex Cloud services
    • All guides
    • Using functions to get an IAM token for a service account
    • Connecting to managed databases from functions
      • Invoking a function
      • Invoking a function asynchronously
      • Authenticating when invoking a private function via HTTPS
    • Viewing operations with service resources
  • Tools
  • Pricing policy
  • Access management
  • Terraform reference
  • Monitoring metrics
  • Audit Trails events
  • Release notes
  • FAQ
  1. Step-by-step guides
  2. Invoking a function
  3. Invoking a function

Invoking a function

Written by
Yandex Cloud
Updated at May 5, 2025

To allow any user to invoke a function without passing an authorization header, make it public. For more information about access rights, see Access management in Cloud Functions.

Invoking a functionInvoking a function

As an example, we use the function described in Creating a function version.

Management console
HTTPS
CLI
Yandex Cloud Toolkit
  1. In the management console, select the folder containing your function.

  2. Select Cloud Functions.

  3. Select a function.

  4. Go to the Testing tab.

  5. In the Version tag field, specify which function version to invoke.

  6. Under Payload template, choose one of the options:

    • No template: Custom data format.
    • HTTPS invoke: Data format for a function acting as an HTTPS request handler. For more information, see Concepts.
    • Trigger for Message Queue: Data format for the function invoked by a trigger in order to process messages from the queue.
    • Skill for Alice: Data format for invoking the function receiving requests from Yandex Dialogs.
  7. In the Payload, enter the input data to test the function.

  8. Click Run test.

  9. You will see the testing status under Test result in the Function status field. Important: Maximum function execution time before timeout (including original initialization at first call) is 10 minutes.

  10. You will see the function execution result in the Function output field.

You can find the function invocation link in:

  • Link to invoke field. To do this, in the management console, select Cloud Functions and click the required function row.
  • http_invoke_url parameter. To do this, run the following command:
    yc serverless function get <function_name>
    

To find out the name or unique ID of a function, get a list of functions in the folder.

For security reasons, you can only invoke a function via HTTPS. Invoke it as a regular HTTP request by inserting the function invoke link in the browser address bar. The link should have the following format:

https://functions.yandexcloud.net/<function_ID>

You can invoke a specific function version using the tag parameter. The function with the $latest tag is invoked by default.

  • Example of function invocation with no additional parameters:

    https://functions.yandexcloud.net/<function_ID>
    

    The following response will appear on the page:

    Hello, World!
    
  • Example of function invocation with the name parameter added to the URL:

    https://functions.yandexcloud.net/<function_ID>?name=<username>
    

    The following response will appear on the page:

    Hello, Username!
    
  • Example of invoking a specific function version with the tag parameter added to the URL:

    https://functions.yandexcloud.net/<function_ID>?tag=<version_tag>
    

If you do not have the Yandex Cloud CLI yet, install and initialize it.

The folder specified when creating the CLI profile is used by default. To change the default folder, use the yc config set folder-id <folder_ID> command. You can specify a different folder using the --folder-name or --folder-id parameter.

You can invoke a specific function version using the --tag parameter. The function with the $latest tag is invoked by default.

To find out the name or unique ID of a function, get a list of functions in the folder.

  • Invoke the function by specifying in the parameter a name for the greeting:

    yc serverless function invoke <function_ID> -d '{"queryStringParameters": {"name": "Username"}}'
    

    Result:

    {"statusCode": 200, "headers": {"Content-Type": "text/plain"}, "isBase64Encoded": false, "body": "Hello, Username!"}
    
  • Invoke a specific version of the function using the --tag parameter:

    yc serverless function invoke <function_ID> --tag <version_tag>
    

You can call a function using the Yandex Cloud Toolkit plugin for the IDE family on the JetBrains IntelliJ platform.

For more information about the structure of functions called in different ways (HTTPS or CLI), see Invoking a function in Cloud Functions.

Was the article helpful?

Previous
Creating a function version
Next
Invoking a function asynchronously
Yandex project
© 2025 Yandex.Cloud LLC