In WF4 composite activities can be achieved through IActivityTemplateFactory:
public sealed class CompositeActivity : IActivityTemplateFactory
{
public Activity Create(DependencyObject target)
{
return new Sequence
{
Variables = {
new Variable<string>("MyStringVar"),
new Variable<int>("MyIntegerVar")
},
Activities = {
new WriteLine { Text = "My first activity within the composite" },
new Delay { Duration = new InArgument<TimeSpan>(a => TimeSpan.FromSeconds(5)) },
new WriteLine { Text = "My third activity within the composite" }
}
};
}
}
The designer knows IActivityTemplateFactory so it will show up on toolbox as any other activity.