using System.Linq; using System.Net; using Elsa.Activities.Http; using Elsa.Builders; using Elsa.Services.Models; using Microsoft.AspNetCore.Http; namespace Elsa.Samples.CustomActivities { public class EchoQueryStringWorkflow : IWorkflow { public void Build(IWorkflowBuilder builder) { builder .ReceiveHttpRequest("/hello") .Then() .WriteHttpResponse(_ => HttpStatusCode.OK, GenerateSomeHtml, _ => "text/html"); } private string GenerateSomeHtml(ActivityExecutionContext context) { var query = (IQueryCollection)context .Input; // the output of the previous activity will be available as input to this one. var items = query.Select(x => $"
  • {x.Key}: {x.Value}
  • "); return $""; } } }