Workflows
This example assumes using PromptLayer; is in scope and apiKey contains your PromptLayer API key.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 | using var client = new PromptLayerClient(apiKey);
// List available workflows with pagination.
// Each workflow includes its name, latest version number,
// and any release labels (e.g., "prod", "staging").
var response = await client.Workflow.ListWorkflowsAsync(
page: 1,
perPage: 10);
Console.WriteLine($"Total workflows: {response.Total}, Page: {response.Page}/{response.Pages}");
foreach (var workflow in response.Items)
{
var labels = workflow.ReleaseLabels.Count > 0
? string.Join(", ", workflow.ReleaseLabels)
: "none";
Console.WriteLine($" - {workflow.Name} (id: {workflow.Id}, version: {workflow.LatestVersionNumber}, labels: {labels})");
}
|